Drupal - The PHP version is not correctly detected

Drush doesn't use just php directly as a command, but need the full path. With the last version of Drush, you can add the following line in your .bash_profile to set which PHP you want to use.

export DRUSH_PHP=/Applications/MAMP/bin/php/php5.3.14/bin/php

Here is just an example of MAMP, but you can change it as well with your own path.


Here's another solution:

  1. Create a symbolic link to the desired version of php (php5.4 in my case) ln -s /usr/local/bin/php54 ~/bin/php

  2. we need to change precedence of ~/bin in $PATH so that it appeared before /usr/local/bin (where original php interpreter sits) find ~/ -name .bash_profile | xargs sed -i 's/\$PATH:\$HOME/bin/\$HOME/bin:\$PATH/g'

  3. reload .bash_profile source ~/.bash_profile

sourced from: http://webiga.com/2013/06/22/change-default-version-of-php-at-webfaction/

Tags:

Drush