首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在OS上使用AMPPS和Homebrew的钻孔器

在OS上使用AMPPS和Homebrew的钻孔器
EN

Drupal用户
提问于 2017-10-20 17:20:10
回答 1查看 352关注 0票数 2

我正在本地机器上建立一个新的开发环境,并使用AMPPS。我已经安装了钻孔,使用的是自制的,并且正在运行一个Mac (OSX10.12.5塞拉利昂)。

我已经成功地在我的开发环境中安装了一个新的Drupal站点。当我尝试运行drush命令时,我会得到Drush状态以及经典的引导/被监禁的shell消息:

代码语言:javascript
复制
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的输出:

代码语言:javascript
复制
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的路径。
  • 我正在drupal安装的docroot中执行该命令。
  • 我没有~/.my.cnf文件
  • /usr/local/bin中的符号链接用的是Homebrew,而不是AMPPS,但它是用于7.1.10版本的,我正在使用PHP5.6

有很多关于这方面的文章,细节或环境略有不同,我没有办法从这些帖子中得到一个解决方案,所以我想我会把我的问题放在具体的场景上。

我主要使用以下说明:https://www.drupal.org/node/954766

EN

回答 1

Drupal用户

回答已采纳

发布于 2017-10-20 18:07:12

即使我导出了Drush PHP路径,我也没有在.bash_profile中添加到AMPPS的mysql的链接。解决了我的问题。

代码语言:javascript
复制
nano ~/.bash_profile
export PATH=$PATH:/Applications/AMPPS/mysql/bin
source ~/.bash_profile
票数 3
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/248510

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档