hey, ive had this working before on frihost, but i cant seem to get it working again. What is the best commands to use in the standard cron tab in cpanel to get a php script to run at the set interval?
Thanks a lot
In your cpanel, There is a cron jobs tab. There, go and select the details of when to run the script. eg once a day, once every 5 minutes etc.
In the command box, enter the command
php -f /home/<your-user-name>/www/<yourscript>.php
actually, I use another command.
What I use is php -q /....../file.php. I'm not really sure what the difference is, but people recommend to use -q as opposed to -f
And most of the time I use the full path to PHP as well (that is, /usr/bin/php -q /....../file.php
How did you find this thread thnn? It's from September! Maybe I should -close- it.
And, /usr/bin/php -q omits the headers from the output. That's why it's better for cron jobs. If an error does occur and you use /usr/bin/php -f, you'd get some HTTP headers in the output, which is not what you want.