我全神贯注地寻求解决方案,但我只是找不到它 . 我试图在我的MAMP平台上使用drush(我有Leopard) . 安装似乎进展顺利,但是当我尝试使用它时会出现错误 .
我的默认shell是tcsh . 我创建了一个.bash_profile文件,并在其中添加了“export PATH =”/ Applications / MAMP / Library / bin:/Applications/MAMP/bin/php5.3/bin:$ PATH“行 . 然后我改为bash shell并发送命令:drush en views_ui . (我从tcsh shell得到同样的错误)
我是该网站的根 .
对不起,如果这是一个重复的问题 . 请帮忙...
bash-3.2$ drush en views_ui
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to [error]
run this command.
The drush command 'en views_ui' 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 was attempting to connect to:
Drupal version : 7.0
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database username : root
Database name : d7dev
Default theme : garland
Administration theme: garland
PHP configuration : /private/etc/php.ini
Drush version : 5.8
Drush configuration:
Drupal root : /Applications/mamp/htdocs/d7dev
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array
3 回答
所以我知道这是一个旧版本,但您是否尝试了https://drupal.org/node/1428638(上面的错误消息中提供的URL)的解决方案?
结果是您应该使用以下命令更新settings.php中的数据库'host'值:
对我来说很棒 .
我在本地dev上遇到了同样的问题( not 使用XAMP或MAMP) . 我所做的只是安装php5-mysql和drush en work .
对于像我这样对XAMPP有同样问题的人来说,在这篇文章中如何以某种方式结束 . 以下代码对我来说很有用 . 确保你首先“cd”到你的Drupal root .