I have a PHP script that I want to run every four hours. I have set it up to run in Windows Task Scheduler by calling my Firefox browser and running the script. The ‘Action’ line in Task Scheduler is:
That works, but inevitably also opens a blank tab in the browser, which I’d like to avoid (although for testing purposes it was quite handy because I could show error messages).
I’m sure there should be a way of running the script without calling Firefox (as if from a command line), but I’ve tried:
Actually it does try (so the command line itself is likely OK), but there’s a PHP warning followed by a fatal error message because a PHP ‘required’ file can’t be found. I shall try putting the absolute path to this file instead of the relative path that works OK within the browser.
If that works there are likely to be a number of other relative paths that will need adjusting before it all runs as required.
LATER: Yes, that fixed it. Thank you. When it runs in Task Scheduler the Windows Command Prompt window flashes up briefly, but it hadn’t been showing the error messages that I saw when I ran directly from the Command Prompt. A useful lesson learned.