我安装了多个版本的 PHP,对于我的正常开发,我总是使用通过自制软件安装的 PHP 5.5.x。
在鱼壳里
which php & php --version
=> /usr/local/bin/php
=> PHP 5.5.8 (cli) (built: Jan 16 2014 15:58:25)
路径是正确的。
我的问题是,当我必须使用 Drupal 进行开发时,我使用 MAMP 作为捆绑的灯堆栈,并且 MAMP 包含自己的 php 版本。我的问题是,在将 Drush 与 Drupal 一起使用时,我无法像通常在 bash 中那样设置 PHP 可执行文件路径。我只想 drush 使用捆绑的 PHP 版本/可执行文件。
在 bash 我可以这样做:
# Set Drush root to MAMP PHP
export DRUSH_PHP=/Applications/MAMP/bin/php/php5.5.3/bin/php
但这在鱼壳中不起作用,我尝试了这个(没有成功):
鱼配置位置:~/.config/fish/config.fish
set -x DRUSH_PHP=/Applications/MAMP/bin/php/php5.5.3/bin/php
如果我运行fishshell,drush status
我总是会得到这个:
Drupal version : 7.26
Site URI : http://default
Database driver : mysql
Database username : root
Database name : dev-db
Default theme : garland
Administration theme : garland
PHP executable : /usr/local/bin/php
PHP configuration : /usr/local/etc/php/5.5/php.ini
PHP OS : Darwin
Drush version : 6.2.0
Drush configuration :
Drush alias files :
Drupal root : /Applications/MAMP/htdocs/Sandbox/dev
Site path : sites/default
File directory path : sites/default/files
当我在 bourne shell 中运行相同的命令时,我得到了正确的设置:
Drupal version : 7.26
Site URI : http://default
Database driver : mysql
Database username : root
Database name : dev-db
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : bartik
Administration theme : seven
PHP executable : /Applications/MAMP/bin/php/php5.5.3/bin/php
PHP configuration : /Applications/MAMP/bin/php/php5.5.3/conf/php.ini
PHP OS : Darwin
Drush version : 6.2.0
Drush configuration :
Drush alias files :
Drupal root : /Applications/MAMP/htdocs/Sandbox/dev
Site path : sites/default
File directory path : sites/default/files
Temporary file directory path : /Applications/MAMP/tmp/php
那么,如何在fish中设置DRUSH_PHP的导出路径呢?