0

I get this strange error when I try to run a php file from anywhere in the system:

Could not open input file: drush.php. 

...except for its own directory. When I try invoke it from its own directory, no problem -- everything works!

Is there a permissions issue here? I looked under security tab in the properties for the file, but every user was given all the permissions that are available.

So I don't get why Windows is not able to open this file from any other directory except where it is located.

1
  • Is the .php file you're trying to run actually called drush.php? Commented Jul 1, 2009 at 1:57

3 Answers 3

0

It could be a "working directory" issue. Have you tried making a shortcut to it on the desktop, then right-click, properties, and change "start in" to the folder where the php file is?

2
  • yeah, that worked. so what do you think i should do? keep using the shortcut rather than the batch file? -- i dont know if i mentioned that the file is being invoked by drush.bat. Commented Jul 1, 2009 at 3:35
  • You could use the shortcut or edit the batch file to do "cd c:\yourpath" before it runs that command. You might also want to try t the PATH comment below to see if that does the trick. Commented Jul 1, 2009 at 16:04
1

the file drush.bat from the php folder contains:

@php.exe "%~dp0drush.php" --php="php.exe" %* 

I replaced it with

@php.exe "%~dp0/PEAR/drush/drush.php" --php="php.exe" %* 

the actual path to the drush.php was not directly in the php folder, it was in php/PEAR/drush

0

Try adding the path of the PHP bin folder to your %PATH% environmental variable

Usually in C:\Program Files\PHP\bin (or C:\Program Files (x86)\PHP\bin) or C:\PHP\bin

1
  • actually i tried that. it didn't work. same error. Commented Jul 1, 2009 at 3:27

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.