7

I've gone through the setup instructions on https://github.com/drush-ops/drush, but I can't seem to get drush to use a different configuration file, very frustrating.

I've already added the PHP_INI environment variable to my .bashrc and sourced it, seems like there is something I'm missing.

1
  • Did you try echo $PHP_INI to make sure that the environment variable is really set?
    – apaderno
    Commented Oct 16, 2015 at 8:25

2 Answers 2

3

drush uses PHP CLI which has it's own php.ini file

e.g, in ubuntu:

/etc/php5/cli/php.ini

You can use that.

3

I copied my php.ini file to my home directory, and then ran:

$ PHP_INI=~/php.ini drush status

The "PHP configuration" line accurately reflected the new location of my php.ini file, so I believe this is still working on Drush 6.x and master.

4
  • 1
    i'll just add where to copy the php.ini cp /etc/php5/cli/php.ini ~/.drush/
    – angoru
    Commented Mar 26, 2014 at 4:21
  • For some reason, echo $PHP_INI does not return the value, despite having export PHP_INI="/private/etc/php.ini" in my .bashrc.
    – Steve
    Commented Mar 27, 2014 at 14:42
  • Type source ~/.bashrc from your terminal to re-execute your .bashrc. Editing this file does nothing until you source it, or start a new terminal session. Commented Mar 29, 2014 at 21:11
  • using export PHP_INI="/private/etc/php-cli.ini" in ~/.bashrc to run a different ini file from command line drush worked great on CentOS and PHP7.1
    – HongPong
    Commented Nov 16, 2017 at 17:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.