Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Cron Job to execute PHP script? How to do it on unix? hbirnbaum msg:1255337 1:01 pm on Dec 14, 2004 (gmt 0) I have a PHP script I want to execute automatically once a month. I was thinking Chron job. But, I am not sure of the unix command to execute a script. Can it be the URL of the script I want to execite? How do I set this up in cPanel?
jamie msg:1255338 1:17 pm on Dec 14, 2004 (gmt 0)
if you have php installed as a cgi [ es.php.net], then you can call it as you would another cron job.
if not then you could use lynx - try this post for more info:
[ ...] webmasterworld.com
re: cpanel - i don't. sorry.
p.s. if you search these forums you'll find plenty of references to php and cron.
dmorison msg:1255339 6:17 pm on Dec 14, 2004 (gmt 0)
If you don't have the PHP cgi installed you can use wget to run a PHP script via cron.
The command is simply:
The -O /dev/null part means send the output to the null device so that no disk space is taken up with the HTML (or whatever) output from your script.
Slade msg:1255340 8:15 pm on Dec 14, 2004 (gmt 0)
In the X skin for Cpanel, there is a Cron Jobs tab near the bottom of the main page of icons. I expect it is available in other skins, but it might be one level further in. dreamcatcher msg:1255341 1:32 am on Dec 15, 2004 (gmt 0)
In cpanel the following will also work:
php -q /home/serverpath/script/file.php
Note that -q is seperated by spaces.
There are also some threads on the cpanel forum about settings up cron jobs.
hbirnbaum msg:1255342 12:46 pm on Dec 15, 2004 (gmt 0)
Thanks guys! I appreciate all the info...