Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
This is an error I am encoutnering on my WIndows Vista machine. I have put the drush directory in the path, and when I try drush.bat, this error comes up. But it also happens when I use the file location + drush.bat. Oddly enough, when I run drush.bat from its own directory, it seems to work fine. It doesn't work when I call it from any other directory.
Comment | File | Size | Author |
---|---|---|---|
#25 | drush-506448-25.patch | 452 bytes | alexanderpas |
#17 | drush.bat_.2057074.patch | 258 bytes | legion80 |
Comments
Comment #1
saariant CreditAttribution: saariant commentedI am getting the same error.
Comment #2
saariant CreditAttribution: saariant commentedsolution found here:
http://drupal.org/node/330023
you need to define the hole path to the drush.php file inside the drush.bat file
Comment #3
hass CreditAttribution: hass commentedChange the drush.bat to:
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedComment #5
Durrok CreditAttribution: Durrok commentedPoint it to the where drush.php is at. Ex: Mine is located at C:\drush\drush.php so my drush.bat looks like:
@php.exe C:\drush\drush.php %1 %2 %3 %4 %5 %6 %7 %8 %9
Comment #6
hass CreditAttribution: hass commentedUse #3 only!
Comment #7
Durrok CreditAttribution: Durrok commentedhass - Tried it and it does not work in windows xp. Same error.
I know mine works however. :) Any reason not to do that?
Comment #8
rsvelko CreditAttribution: rsvelko commentedTo sum it up: we have 2 fixes - one for Vista and 1 for XP - the bat file should be patched? How?
Do we need to patch the docs/README?
Comment #9
hass CreditAttribution: hass commentedUse #3 only! It works on all Windows Versions the same way!
@Durrok: I have developed it on WinXP. It must works on all NT versions. Your version is static and will not work in a general way.
Comment #10
legion80 CreditAttribution: legion80 commentedfor me what I did was change the .bat to read:
@php.exe "%~dp0drush.php" %1 %2 %3 %4 %5 %6 %7 %8 %9
(don't forget the quotes).
In DOS batch scripting %~dp0 represents the directory of the batch file.
As long as your php.exe and drush.bat paths are in PATH (which I changed by going to My Computer > Properties > Advanced (tab) > Environment Variables (button), and adding the "PATH" variable (without quotes) set to "
;
;%PATH%" (without quotes)) this should allow you to run drush from any directory.
Comment #11
hass CreditAttribution: hass commentedI tried this clean variant too, but haven't worked...
Comment #12
wingflap CreditAttribution: wingflap commentedI'm running Vista, Uniform Server 3.5, and the current Drush. I've installed Drush in D:\server\drush. Php is located in d:\server\wdrive\usr\local\php.
The php.ini includes a bunch of libraries referenced by: extension = [libraryname].dll for each of the libraries. I set my path to include the drush folder and the php folder as above.
In drush.bat, I changed drush.php to:
@php.exe "%~dp0drush.php" %1 %2 %3 %4 %5 %6 %7 %8 %9
(thanks leigion80 - been a long time since i've been that deep in dos scripting. nice addition.)
When I execute 'drush' (with or without a parameter) from any location (other than the php folder), I see warnings about the inability to load a php extensions library. Then I see the drush help followed by an error saying that drush.php [parameter-if supplied] can't be found:
This is followed by:
Execute a drush command. Run `drush help [command]` to view command-specific help.
if no parameter is provided or:
Could not open input file: d:\server\drush\drush.php status
if a parameter (like status) is provided.
When I run within the php folder, I don't get the library errors, but I still get the same drush errors. Sounds like I have 2 problems. I want to be able to call drush from any folder (like a /sites/all/modules folder) and still have php load properly. And second, the file not found error.
Anyone else using Uniform Server? Are you having similar problems? I've been beating my head over this but I'm drooling from what I'm seing this thing being capable of. I'd really like to get this working in an XP/Vista environment.
Comment #13
wingflap CreditAttribution: wingflap commentedFound a typo in my Path statement.
I've gotten rid of the drush.php not found. When I'm not in a site folder, I see the usual library load errors followed by:
Could not find a valid Drupal installation
(which is good)
When I run it in a folder with a site, I get html spit out at me which basically translates to this:
So for me, it appears that drush is functioning with the exception of loading php correctly (which I would consider a limitation ;) ). How do I invoke php from the batch file run from within a website folder so that the integrity of php's ini file and the relative locations of the extensions (libraries) are maintained? If I figure this out, I'll be drushing away!
---UPDATE---
Great explanation of running php CLI in the Uniform Server Wiki:
http://wiki.uniformserver.com/index.php/PHP_CLI:_PHP_INI
You can create a separate php ini file for your command line PHP execution that's separate from php invoked by the server. Hope this is helpful to someone. The suggestions above put me on the right track.
Comment #14
Durrok CreditAttribution: Durrok commented@hass ... your version does not work though? If you change the path in mine (as I advise to do) that will work on any PC.
I have tried yours on three different machines with drush installed, each in a different directory, and none of them worked with your method. However if I changed the path in mine it worked every time.
I understand it will not work in a "general" way, but I think most people can understand changing a path.
Comment #15
hass CreditAttribution: hass commentedI was not able to get "%~dp0drush.php" working, but also tried it... haven't had the time to dig deeper why. "%0\..\drush.php" works, but now looking on the double quotes this should be added, too only to be save than sorry.
Comment #16
legion80 CreditAttribution: legion80 commentedTry prepending an echo line and see if the path makes sense. This is what the drush.bat should look like
Comment #17
legion80 CreditAttribution: legion80 commentedHaven't seen this applied to the latest HEAD, so here's a patch for it.
Comment #18
moshe weitzman CreditAttribution: moshe weitzman commentedcould someone review the latest patch?
Comment #19
hass CreditAttribution: hass commentedHasn't worked for me.
Comment #20
vegemite4me CreditAttribution: vegemite4me commented#10 worked for me.
Comment #21
legion80 CreditAttribution: legion80 commented@hass You said that %0 worked for you but %~dp0 didn't. Did you try my suggestion and echo out the output for both? Do you mind posting the results of "%0\..\drush.php" and "%~dp0drush.php"?
Comment #22
awolfey CreditAttribution: awolfey commentedPatch + #10 works for me.
Comment #23
manasiv CreditAttribution: manasiv commentedThe patch in #17 by legion80 works for me.
Comment #24
moshe weitzman CreditAttribution: moshe weitzman commentedComment #25
alexanderpas CreditAttribution: alexanderpas commentedappending to this issue, as it is already referenced inside the batch file.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs...
Comment #26
moshe weitzman CreditAttribution: moshe weitzman commentedis there something to do here?
Comment #27
legion80 CreditAttribution: legion80 commentedi think this might just be an improvement over the last version, in that all of the arguments that were included in the drush command are passed to the .php file, rather than the first 9 arguments.
i have not tested this yet, but if this works, then i think this should be applied.
Comment #28
moshe weitzman CreditAttribution: moshe weitzman commentedCan anyone confirm that this most recent patch works?
Comment #29
bpeter CreditAttribution: bpeter commentedyes, it works.
Comment #30
alexanderpas CreditAttribution: alexanderpas commentedas it has been confirmed...
Comment #31
Frank Ralf CreditAttribution: Frank Ralf commentedCurrent HEAD version does work on Win 2000 SP4. When setting the drush directory in the PATH environment variable entering "drush" is enough to run the program (no ".bat" needed).
Frank
Comment #32
moshe weitzman CreditAttribution: moshe weitzman commentedcommitted #25
Comment #34
askibinski CreditAttribution: askibinski commentedFor any acquia stack users who stumble on the message "php5ts.dll missing" error and end up in this thread (because it it mentioned in the default drush.bat):
Try this in your bat file: