Closed (fixed)
Project:
Drush
Component:
Documentation
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 May 2009 at 06:48 UTC
Updated:
31 Oct 2009 at 19:50 UTC
Jump to comment: Most recent file
If I run the drush command it is unable to detect that it is infact in the drupal root directory.
Specifying the root directory doesn't resolve this either.
li37-144:/home/user/public_html/drupal# dr status -v 2
Found command: status [bootstrap]
Could not find a valid Drupal installation
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | drush_safe_doc.patch | 501 bytes | anarcat |
Comments
Comment #1
owen barton commentedDo you have a sites/default/settings.php with a valid database in this Drupal root?
Comment #2
troynt commentedli37-144:/home/user/public_html/drupal# find -name 'settings.php'
./sites/default/settings.php
Yes.
base url & database are both specified in the settings.php file.
My install is pretty vanilla, this is a fresh install no modules added.
I've ran into issues with this newer version on every site I've attempted to use it on.
The module version works fine, however I get that ugly "revoked" error.
Comment #3
troynt commentedAdd -d safe_mode=Off flag to command.
drush='php -d safe_mode=Off ~/drush/drush.php'
This should be in the readme.
Comment #4
moshe weitzman commentedComment #5
fenstratsafe_mode=Off
This should be in the readme.
Agreed, php's safe mode is a game wrecker.
Need to make sure alias' are defined as:
alias drush='php -d safe_mode=Off /path/to/drush/drush.php'
It also appears that sequential commands called from drush are still running in safe mode (haven't had a chance to look deeper so this is a stab in the dark):
drush updatereports code update completed [ok] yet its call to updatedb fails saying there's no valid drupal installrunning them seperatly, i.e. calling
drush updatecodethendrush updatedband both complete [success].Comment #6
fenstratAll the above issues I mentioned are resolved if safe_mode is turned off globally (i.e. in php.ini)
If altering drush to work within safe_mode restrictions isn't an option (and I'm guessing it's not), then at least the readme needs to make prominent mention of the fact that drush doesn't work with php's safe_mode on.
Comment #7
anarcat commentedThis seems pretty minor then, just a documentation change... What do you think of this one?
Comment #8
fenstratNo good. Turning off safe_mode works for single commands, e.g. updatecode, updatedb. However the update command calls updatedb AFTER updatecode which will then revert to global php.ini settings. So no good unless safe_mode is turned off globaly in php.ini
Could each subsequent call to drush keep any inbound parameters, i.e. safe_mode=Off? Or just easier to make safe_mode=Off a requirement?
Comment #9
anarcat commentedI think having safe_mode off in php.ini could be a requirement. I fail to see what fail_safe gains anyone in commandline anyways...
Comment #10
moshe weitzman commentedSeems like we should do a very fast requirements check at beginning of script. we should check safe_mode and php version (seems like we have issues on php4 and i don't care).
Comment #11
moshe weitzman commentedFYI, I have just issued an RC1 release.
Comment #12
owen barton commentedI have a patch for checking php5 and safe_mode in my sandbox - I'll try and polish it up.
Comment #13
owen barton commentedCommitted checks for php5 and safe_mode in _drush_bootstrap_drush_validate()
Comment #14
owen barton commentedComment #15
owen barton commentedHmm, this doesn't really help - the try/catch for PDO at the bottom of environment.inc still causes "Parse error: syntax error, unexpected '{' in .../drush-head/includes/environment.inc on line 777" in php4, which is totally unhelpful and unfriendly.
I guess we have have several options:
* Move the PDO validation to a separate inc, and conditionally include it when needed (which would be after the php version validation, so we wouldn't need a specific check)
* Figure out another way of doing it, other than try/catch
* Exec it as a string
* Move the PHP version detection and message out of the "official" validation function, and to the very top of drush.php (so we can die() before hitting the includes.
Any preferences?
Comment #16
adrian commentedhow about adding a commands/core/php engine
and making a bootstrap.inc with only that bit
Comment #17
owen barton commentedComment #18
owen barton commentedMoved PHP version check to drush.php, since environment.inc try/catch doesn't parse in php4. At some point we could move this to an engine, if we find enough cases to make it worthwhile.
Comment #20
Detroit Dan commentedThe only way I can get drush to work on my web.com Linux system is to bypass php.ini (-n option). So I changed the drush bash shell to invoke drush.php as follows: /usr/bin/env php -nd safe_mode=Off $SCRIPT_PATH "$@"
I'm using PHP 5.2.10 (cgi) (built: Aug 20 2009 07:17:05)
Zend Engine v2.2.0