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.

picardo
  • 147
  • 3
  • 11

3 Answers3

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

ovi_mihai
  • 11
  • 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?

Adam Brand
  • 6,127
  • 2
  • 30
  • 40
  • 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. – picardo Jul 01 '09 at 03: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. – Adam Brand Jul 01 '09 at 16:04
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

Jack B Nimble
  • 1,505
  • 1
  • 10
  • 13