我正在遵循此页面上列出的Drush安装说明:https : //github.com/drush-ops/drush/blob/master/docs/install.md
我似乎在代码内收到语法错误:
[user@localhost ~]$ wget https://github.com/drush-ops/drush/releases/download/8.0.0-rc4/drush.phar
--2015-11-16 16:23:02-- https://github.com/drush-ops/drush/releases/download/8.0.0-rc4/drush.phar
Resolving github.com (github.com)... 192.30.252.131
Connecting to github.com (github.com)|192.30.252.131|:443... connected.
HTTP request sent, awaiting response... 302 Found
2015-11-16 16:23:05 (1.47 MB/s) - drush.phar saved [3496991/3496991]
[user@localhost ~]$ php drush.phar core-status
Parse error: syntax error, unexpected '[' in phar:///home/user/drush.phar/includes/output.inc on line 188
我没有在Google上看到此错误。知道如何解决吗?
您正在使用哪个版本的PHP?
—
kiamlaluno
您是否在Drupal目录中运行drush?
—
没有Sssweat
PHP 5.3.29 (cli) (built: Nov 3 2015 15:43:40) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
当我在Drupal目录中运行时会发生这种情况,而当我不在目录中时会发生这种情况。无论如何,我认为这不是Drush通常对找不到安装的反应。其他版本已正常退出。
—
艾塞克斯(Essex)的理查德(Richard of Essex)
我将添加以确保您检查是否
—
用户
DRUSH_PHP
设置了环境变量。我花了太长时间试图弄清楚为什么drush不使用php 5.6,即使那是我在路径中配置的。原来我DRUSH_PHP
很早以前就设置了我的php 5.3路径。unset DRUSH_PHP
为我解决了这个问题。