I'm running Drush on a host that has multiple versions of PHP installed. By default, php --version would give you 5.2.x, but php53 and php54 are also available. So in my .bash_profile I have alias php='php53' (php --version = 5.3.13), which generally makes Drush happy.

However, I still get "Your command line PHP installation is too old. Drush requires at least PHP 5.3.2" messages for some very useful commands.

A couple of really annoying instances:
- drush pm-update will report that it has backed up and then updated all modules and core successfully, then return the PHP version error and restore all backups. I assume the error comes when it attempts to run database updates, but I'm not sure
- drush archive-dump will immediately return the PHP version error

The other commands I have tried so far work fine. I'm not sure why this would be, if Drush is sometimes using the php53 binary, and other times not, or if it just has trouble detecting the version correctly, but some very important features are broken for me.

Comments

handsofaten’s picture

Running Drush in verbose mode, the error comes after it attempts this command:
php /home/[username]/drush/drush.php --backend=2 --verbose --root=/home/[username]/webapps/drup --uri=http://[domain name] pm-updatecode-postupdate 2>&1

handsofaten’s picture

Status: Active » Closed (works as designed)

Got an answer on drupal.stackexchange.com. The solution was to export DRUSH_PHP in .bash_profile with a path to the appropriate PHP binary. In my case (a WebFaction server):

export DRUSH_PHP='/usr/local/bin/php53/'

revnoah’s picture

Version: » 7.x-5.9

Also on a WebFaction server. This worked for me with one tiny adjustment: removing the trailing slash.

export DRUSH_PHP='/usr/local/bin/php53'