Drupal

Step by step guide to setup Apache Solr 5.x in CentOS 7 for Drupal 7 Panopoly distro using Search API

As of this writing, the latest version of Solr is 5.2.1. In this step by step guide we will install that version and integrate it with Drupal 7 Panopoly distro site using Search API module. Actually, Panopoly distro is already shipped with Search API and Search API Solr Search modules. All we need to do is to configure the pre-setup Search API Solr server and index. The good thing about using Search API is that it is already integrated with Views module and we can do unlimited customization with our search results.

Using SASS in Bootstrap Drupal theme

As of this writing, Bootstrap Drupal theme only supports LESS. This tutorial will show how to create bootstrap sub-theme supporting SASS and use Grunt to manage our workflow effectively. My operating system is Windows. Therefore, the shell commands, output, etc. that will be shown here are for Windows.

Solution to so many redirects error executing independent PHP script in a Drupal 8 site running under nginx

The issue is when executing a standalone PHP script in a Drupal 8 site running under nginx gets "The page isn't redirecting properly" error in Firefox and getting this error in Chrome: "This page isn't working [domain] redirected you too many times." but the PHP scripts that executes under Drupal 8 bootstrap don't get this issue. The bug must be on nginx webserver configuration. Investigating the nginx configuration file php_pass.conf that handles my Drupal 8 site PHP scripts:

Drush can't connect to MySQL server on localhost using WinNMP on Windows

First time I setup and test Drush on my local machine using WinNMP on Windows executing a cache clear on a local Drupal site under Git BASH or cygwin:

  
drush @webfoobar cache-rebuild
  

... I get this error:

  
No Drupal site found, only 'drush' cache was cleared
  

I excuted the following drush command to investigate the cause of the error:

  
drush @webfoobar -d st
  

... got the following output message:

Solution to "The filename, directory name, or volume label syntax is incorrect." error in Drush custom PHP path

It is possible to assign a specific PHP version to execute Drush commands for special Drupal site via Drush aliases configuration file. However in Windows, we can get error:

  
The filename, directory name, or volume label syntax is incorrect.
  

… if the we follow the Windows syntax path.

This error is printed from C:\composer\vendor\drush\drush\includes\exec.inc

Tags

How to use your custom php.ini in Drush

The following codes shows how can we tell Drush to use our custom php.ini:

  
$aliases['wf'] = array (
  'uri' => 'http://d8webfoobar.loc',
  'root' => 'C:/WinNMP/WWW/drupal',
  'php' => 'C:/WinNMP/bin/PHP/64bit-php-7.2/php.exe',
  'php-options' => '--php-ini=C:/WinNMP/conf',
);
  

To test, execute the following command:

  
drush @wf status
  

The screenshot is the output of the command above showing that the custom php.ini is already recognized by Drush:

Tags

Smart IP Drupal 8 settings explained

The following is the explanation of each Smart IP Drupal 8 settings.

Database Update Status

This Smart IP section setting will only appear if your Data Source is either IP2Location binary database or MaxMind GeoIP2 binary database. It display the status of database update process from manually executed or automatically during cron run. If the database update failed, you can manually force the database update by clicking the "Update database now" button.

Run your legacy projects in PHP 5.6 along with Laravel Valet that runs under PHP 7.2 in macOS

As of this writing, the latest Laravel Valet requires PHP 7.2. What if you still have legacy projects or Drupal 6 modules you maintain that can't run under PHP 7.2? It would be nice if Laravel Valet has option to run multiple PHP versions but there isn't one. Laravel Valet uses nginx + php-fpm and we can tap to nginx and php-fpm's configurations to make possible to run our legacy projects in PHP 5.6. This will make our nginx running both PHP 7.2 and PHP 5.6.