Score:0

Change the PHP binary that should be used from Drush

in flag

I'm on an Ubuntu shared server hosted at pair.com. Their default PHP version is 7.4, but I was able to change it to PHP 8 for Drupal in my .htaccess; Drupal 9 works fine. My composer specifies PHP 8 and Drush 11.

When I run ../vendor/bin/drush, it thinks I'm using PHP 7.4.

Composer detected issues in your platform:

Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28.

In the .bashrc file, I set DRUSH_PHP to the PHP 8 binary, but it is still trying to use PHP 7.4.

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

Is there another way to tell Drush which PHP binary must use?

cn flag
When you call `/usr/local/bin/php8 path/to/drush-binary` it works, right? If so, you can add a bash alias or variable in your script, etc.
pglatz avatar
in flag
yes, thanks, I just figured that out - works great!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.