3

This question already has an answer here:

I have PHP 5.6 and 7.1 on my system. I want to use PHP 5.6 for the Drupal 7 projects, and PHP 7.1 for the Drupal 8 projects.

I am having problems getting this setup. In the documentation I found that I should set an alias like this in my ~/.zshrc.

 alias drush='DRUSH_PHP=/usr/bin/php56 /usr/bin/drush'

The problem is that when I start a new terminal and run drush ev 'print PHP_VERSION', it still prints out 7.1.6.

I tried to alias PHP to /usr/bin/php56 but that also did not work.

I also tried the following suggestions (and many others), but they didn't work.

I think this changed in more recent Drush versions, like version 8.1.12 I am using.

Can anyone help me find the correct way to do this in more modern Drush versions?

marked as duplicate by kiamlaluno Feb 9 at 19:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I managed to put the correct php default in cli by putting it first in my path. I get the correct response now when I do php -v but drush stopped giving any output. – Jarco Jul 14 '17 at 19:53
0

Did you try in your .profile:

export DRUSH_PHP='usr/bin/php56'

I think you are mixing up alias with setting an environment variable.

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