Score:-1

Drush using wrong PHP binary/config

at flag

Using D9 with Drush 10. MacOS/MAMP Pro.

Drush 10 is installed locally using composer and is starting fine and finding the database. sqlc works fine. (I have other Drupal sites that are working just fine with their composer drush, though they are Drupal 8)

The problem seems to be the php binary/config drush is using. In drush status I see:

PHP binary: /usr/bin/php

PHP config: /etc/php.ini

The PHP doesn't match what I see in terminal, it should use the MAMP PHP:

which php: php: aliased to /Applications/MAMP/bin/php/php7.4.2/bin/php -c "/Library/Application Support/appsolute/MAMP PRO/conf/php7.4.2.ini"

php -v PHP 7.4.2 (cli) (built: Feb 17 2020 12:56:02) ( NTS )

I also have export DRUSH_PHP=/Applications/MAMP/bin/php/php7.4.2/bin/php

I can't think of what other config would be affecting which php drush is using... Any help would be appreciated.

Jaypan avatar
de flag
What file did you add the `export DRUSH_PHP` to? Did you restart your terminal after that?
leymannx avatar
ne flag
Drop MAMP. Switch to DDEV.
Score:2
vg flag

Try to run drush with your MAMP php, like:

./Applications/MAMP/bin/php/php7.4.2/bin/php vendor/drush/drush/drush
Sia Seeya avatar
at flag
Amazing! Great idea, this works. But I wonder why it's not using the native php to the terminal...
Kevin avatar
in flag
Because its two different runtimes.
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.