Hi all,
I recently experiencing the problem on my local after i installed the zend server a few days before. But due to this problem i uninstalled the zend server and my drupal site is working fine but drush is showing this error:
Macbook-Air:drupal7 apple$ drush cc
Command cache-clear needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command. [error]
The drush command 'cc' 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.
Drush was attempting to connect to :
Drupal version : 7.12
Site URI : http://default
Database driver : mysql
Database hostname : 127.0.0.1
Database username : root
Database name : new_drupal
Default theme : garland
Administration theme: garland
PHP configuration :
Drush version : 4.5
Drush configuration:
Drush alias files :
Drupal root : /Users/apple/Sites/drupal7
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array
I enquired about the php config file :
Macbook-Air:drupal7 apple$ which php
/opt/local/bin/php
Macbook-Air:drupal7 apple$ whereis php
/usr/bin/php
Macbook-Air:drupal7 apple$ type -a php
php is /opt/local/bin/php
php is /usr/bin/php
As referenced in this issue: http://drupal.org/node/1393232
I think drush is not able to load php configuration file. How to force drush to use the same config file as my drupal installation.
Any Help would be great ???
Comments
Comment #0.0
Amit Dwivedi CreditAttribution: Amit Dwivedi commentedLink to another related issue is added as a reference.
Comment #1
techgirlgeek CreditAttribution: techgirlgeek commentedI'm having this exact issue since trying to upgrade to drush 7.x-5.
The drush that comes installed with the Acquia Dev desktop seems to work, but that cannot be updated easily to the current release. I've done brand new git pulls of the drush repository, and continue to get the same error.
I've even tried to use the --php option when running drush, still no luck.
Thoughts?
Comment #2
techgirlgeek CreditAttribution: techgirlgeek commentedMy error:
Comment #3
techgirlgeek CreditAttribution: techgirlgeek commentedAfter following the different threads about this issue, I realized that my system seems to be getting confused between the Mac installed version of PHP, which has the executable running out of /opt/local/bin, and the PHP installed with either XAMPP or in my case Acquia Dev enviroment/DAMP.
I went to /opt/local/bin and sudo mv php php.bak.
Edited my ~/.profile file to make sure only the currently in use version of PHP is in the path.
This now uses the correct version of php and finds the php.ini path needed, and shows in the PHP Configuration line in the status information.
Comment #4
jorgensean CreditAttribution: jorgensean commented[#3] started me on the right path, but I still couldn't get drush to bootstrap -
I'm using Acquia Dev Desktop, and the php version for my site is 5.2.17, however, drush was still trying to bootstrap with 5.3.9
However, with some ~/.bash_profile (not ~/.profile) tweaking, I seem to have got it-
Note: the alias is the important one, the path just makes it so php 5.2 is the default command line version (note, I also renamed /usr/bin/php to /usr/bin/phpbak) of php.
Thanks for getting me started on the right path!
Comment #5
Amit Dwivedi CreditAttribution: Amit Dwivedi commentedAs i suspected drush was not able to get the correct php.ini file.
Thanks to techgirlgeek's (#3) advise -
Move the php to php.bak:
Now Drush is using correct php.ini file.
Comment #6
Amit Dwivedi CreditAttribution: Amit Dwivedi commentedfixed and closed.
Comment #6.0
Amit Dwivedi CreditAttribution: Amit Dwivedi commentedcorrected typo!
Comment #7
jschoen CreditAttribution: jschoen commentedThanks so much! I spent a long time Googling this. I was getting the following errors when trying create a new subtheme using Omega 4 and Drush and #4 was the perfect solution. I to am using Acquia Dev Desktop. I have a feeling others will be looking for this also so I hope this helps!
Comment #8
tahiche CreditAttribution: tahiche commentedI know this is stupid, but...
I downloaded the example.drushrc.php file, renamed it to drushrc.php and placed it in sites/all foder.
Creared Drush cache, but "Drush configuration" info was still blank, no sign of my drushrc.php file.
The example.drushrc.php is totally commented out (logical) as soon as i added a no-comment $options[] it showed up!!.
Seems like since there was nothing to read Drush didn´t bother to point to that location.
Comment #9
bwoods CreditAttribution: bwoods at AOL commentedFor whatever reason on a fresh install, mysql wasn't able to be loaded. I had to manually add to my path. I found details here - http://www.webbykat.com/2012/06/solving-sh-mysql-command-not-found-mamp-... .