PHP CLI and Task Scheduler problem
I thought I had set up a successful schedule in Windows to run a PHP script. But all I got was an error whic开发者_Python百科h slaps only when run through the task scheduler.
Here is how I run the task:
I created a batch file runCron.bat:
start php.exe reportGenerator.php
and placed reportGenerator.php in the same folder as of the batch file.
When I manually execute the batch file, all is well. But when the same batch file is called by the task scheduler, PHP CLI throws the following error:
Could not open input file: reportGenerator.php
What would have been missed? I understand it's a path issue, but where exactly is the issue?
Thank you for any help.
try
start php.exe -f c:\full\path\to\reportGenerator.php
it probably looks for the script in the schedulers working directory, not in the bat file dir
精彩评论