Welcome to WebmasterWorld Guest from 22.214.171.124 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
Cron Job to execute PHP script? How to do it on unix? hbirnbaum
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?
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.
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.
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
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.
Thanks guys! I appreciate all the info...