I am trying to run Drush on Windows by using the --root flag. But I am coming across this error:
Does anyone know what to make of this?
C:\Users\picardo-alt>drush.lnk --root=C:\Users\picardo-alt\Sites\pressflow\
The directory 1 does not contain a valid Drupal installation
The command 'drush.php C:\Users\picardo-alt\Sites\pressflow\' could not be found.
There is a valid Drupal install in that directory.
Comments
Comment #1
jasonb815 commentedI know this is a relatively old thread, but, I am getting the same error when trying to execute a drush command via a php script that is executed via an exim mail transport rule. (say that three times fast!). If I run the drush (as root) from the command line it executes with no problems.. Any ideas?
thanks!
Comment #2
greg.1.anderson commentedpermissions or $PATH not right?
Comment #3
jasonb815 commentedThats what I was thinking, but, if I have it execute the status command via drush it works perfectly. ????
Comment #4
ergophobe commentedSimilar problem, albeit on a *nix server
If I change to the directory with the settings.php file, drush behaves roughly as expected (typically works better if I use upc and updb as separate commands than if I try using up by itself).
I've tried all the other types of invocation
drush --root=/path/to/sites/sitnename --uri=example.com statusmodules
drush /path/to/sites/sitename#example.com statusmodules
drush -r /path/to/sites/sitename -l example.com statusmodules
Always the same. I've tried absolute paths and paths relative the the pwd from which I'm invoking drush. I can't get that to work.
I'm guessing this is not so much of a drush problem as a server config issue, but who knows?
$PATH is fine - I can execute drush just fine
Permissions - not sure? As I say, everything works as expected if invoked from within the /sites/sitename dir.
Just for kicks, I tried setting the pwd to the sites/sitename dir and then invoking drush with the absolute path to that directory. In other words, it looks like this
[/home/username/public_html/yosemiteexplorer/sites/sitename]# drush /home/username/public_html/yosemiteexplorer/sites/sitename.com#sitename.com statusmodules
And it returns
The directory /home/username/public_html/yosemiteexplorer/sites/sitename.com does not contain a valid Drupal installation [error]
Command pm-list 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 'statusmodules' could not be executed. [error]
If, from the same directory, I type "drush statusmodules" there's no problem.
Comment #5
greg.1.anderson commentedTry
drush /home/username/public_html/yosemiteexplorer/#sitename.com statusmodules. When selecting a Drupal site via cd, you cd to the folder that contains settings.php (or some child folder thereof), but you must pass the Drupal root to --root and in /path/to/drupalroot#drupalsiteuri.org.\I don't know about the rest of it, though.
Comment #6
ergophobe commentedThanks!
For some reason I thought you had to have the path to the relevant /settings.php file not drupal root.... hmmmm.... I wonder why the flag is called --root ? Perhaps there was a clue in there.
Feeling stupid, but grateful for the help!
Comment #7
greg.1.anderson commentedMarking fixed per #6.