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:

Custom php.ini path in Drush settings file.

The following codes should also work:

  
$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=/WinNMP/conf',
);
  
  
$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' => '-c=/WinNMP/conf/',
);
  
  
$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' => '-c=/WinNMP/conf/php.ini',
);
  
Tags

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.