6

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.

| improve this question | | | | |
  • Did you try echo $PHP_INI to make sure that the environment variable is really set? – kiamlaluno Oct 16 '15 at 8:25
2

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.

| improve this answer | | | | |
2

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.

| improve this answer | | | | |
  • 1
    i'll just add where to copy the php.ini cp /etc/php5/cli/php.ini ~/.drush/ – angoru Mar 26 '14 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 Mar 27 '14 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. – greg_1_anderson Mar 29 '14 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 Nov 16 '17 at 17:17

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