2012-06-04 23 views
0

試圖安裝我的第一個drupal模塊。繼本書因爲「FTP」錯誤而無法工作,所以我安裝了drush。下載似乎現在工作,啓用命令給我這個錯誤。我是Ubuntu和drupal的每一部分的noob。幫幫我。謝謝。嘗試啓用帶有drush的drupal模塊的引導程序錯誤


[email protected]:/var/www/drupal$ sudo drush en module_filter  
Command pm-enable needs a higher bootstrap level to run - you will [error]  
need invoke drush from a more functional Drupal environment to run  
this command.  
The drush command 'en module_filter' could not be executed.   [error]  
Drush was not able to start (bootstrap) the Drupal database.   [error]  
Hint: This error often occurs when Drush is trying to bootstrap a  
site that has not been installed or does not have a configured  
database.and tried it.  

Drush was attempting to connect to :  
    Drupal version : 7.14  
    Site URI   : http: //default  
    Database driver : mysql  
    Database hostname : localhost  
    Database username : drupal7  
    Database name  : drupal7  
    Default theme  : garland  
    Administration theme: garland  
    PHP configuration :  
    Drush version  : 5.3  
    Drush configuration:  
    Drupal root  : /var/www/drupal  
    Site path   : sites/default  
    Modules path  : sites/all/modules  
    Themes path  : sites/all/themes  
    File directory path: sites/default/files  
    %paths   : Array  

You can select another site with a working database setup by  
specifying the URI to use with the --uri parameter on the command  
line or $options['uri'] in your drushrc.php file.  

可能相關:

[email protected]:~$ sudo dpkg-reconfigure -plow phpmyadmin  
[sudo] password for NNH:  
/usr/sbin/dpkg-reconfigure: phpmyadmin is broken or not fully installed  

回答

1

您通常收到錯誤

命令時啓用需要更高的引導水平運行 - 你會 [錯誤]需要從更多功能的Drupal環境調用drush到 運行此命令。

當您在運行命令時不在站點的根目錄中。

如果錯誤持續,請嘗試直接從提示連接到MySQL。嘗試使用從Drush輸出的值連接,即:

mysql -hlocalhost -udrupal7 -p drupal7 

如果這是工作和網站工作,那麼你最有可能可以排除數據庫連接問題。假設您正在本地開發自己的盒子,您可以嘗試在settings.php中將localhost更改爲127.0.0.1。這似乎幫助了一些人。

站點URI設置似乎有點奇怪。

+0

試圖 「/無功/網絡/的Drupal /網站/默認$ sudo的drush恩module_filter」 得到了同樣的錯誤。這是網站的根?從/ var/www/drupal下載命令似乎很開心。將嘗試與MySQL連接,請查找命令。 – NoobNeedingHelp

+0

在這種情況下,網站的根目錄是/ var/www/drupal,所以你似乎從一開始就處於正確的位置。我假設你有/var/www/drupal/sites/default/settings.php。 –

2

Drush基本上是一個命令行界面,用於交互,管理和配置Drupal及其模塊。所以如果你喜歡用Drush來處理與數據庫有關的任何操作,你必須通過循環地址即localhost。但它似乎像Drush瞭解127.0.0.1作爲循環地址,但不是本地主機

只需在settings.php中定義這些參數,就可以讓Drush繼續進行與數據庫相關的任何操作。

而不只是這個

'host' => 'localhost', 

使用此,

'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost', 
相關問題