我正在本地机器上建立一个新的开发环境,并使用AMPPS。我已经安装了钻孔,使用的是自制的,并且正在运行一个Mac (OSX10.12.5塞拉利昂)。
我已经成功地在我的开发环境中安装了一个新的Drupal站点。当我尝试运行drush命令时,我会得到Drush状态以及经典的引导/被监禁的shell消息:
Command pm-list needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal[error]
environment to run this command.
The drush command 'pm-list' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured database. In this case you can select
another site with a working database setup by specifying the URI to use with the --uri parameter on the command
line. See `drush topic docs-aliases` for details.
* connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a
jailed shell. See http://drupal.org/node/1428638 for details.下面是drush status的输出:
Drush was attempting to connect to:
Drupal version : 7.54
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database port :
Database username : myuser
Database name : drupal
PHP executable : /Applications/AMPPS/php-5.6/bin/php
PHP configuration : /Applications/AMPPS/php-5.6/etc/php.ini
PHP OS : Darwin
Drush script : /usr/local/Cellar/drush/8.1.15/libexec/drush.php
Drush version : 8.1.15
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /Applications/AMPPS/www/drupal/docroot
Drupal Settings File : sites/default/settings.php
Site path : sites/default 请注意:
sites/default/settings.php中将localhost更改为127.0.0.1并重新启动服务器export DRUSH_PHP=/Applications/AMPPS/php-5.6/bin/php向php添加了drush的路径。~/.my.cnf文件/usr/local/bin中的符号链接用的是Homebrew,而不是AMPPS,但它是用于7.1.10版本的,我正在使用PHP5.6有很多关于这方面的文章,细节或环境略有不同,我没有办法从这些帖子中得到一个解决方案,所以我想我会把我的问题放在具体的场景上。
我主要使用以下说明:https://www.drupal.org/node/954766
发布于 2017-10-20 18:07:12
即使我导出了Drush PHP路径,我也没有在.bash_profile中添加到AMPPS的mysql的链接。解决了我的问题。
nano ~/.bash_profile
export PATH=$PATH:/Applications/AMPPS/mysql/bin
source ~/.bash_profilehttps://drupal.stackexchange.com/questions/248510
复制相似问题