Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP as a Cron job.

Status
Not open for further replies.

kapok2002

Programmer
Aug 14, 2000
8
US
I need a PHP script to be fired off on a set interval of time.&nbsp;&nbsp;I would like to put it into Cron, but I don't know how to set it up to accept PHP scripts.<br><br>I also heard that I can use a Perl script to call a PHP script.&nbsp;&nbsp;I don't know how to do this either, though.<br><br>If there's a simpler solution, I sure would like to hear it.&nbsp;&nbsp;If there's a solution at all, I sure would like to hear it.
 
Compile PHP as CGI (ie, leave off --with-apache or --with-apxs and keep<br>all the other compile switches the same).<br><br>Then, simply add a line to your cron file using crontab -e (see man 5<br>crontab) like usual.<br><br>Don't forget to call php with the -q option to suppress HTTP headers.<br><br>Alternatively, if you have access to lynx you can leave PHP alone and<br>put the following into your crontab.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;lynx -dump <A HREF=" TARGET="_new"> mails you the results of the script automatically.&nbsp;&nbsp;You can<br>suppress this mail from being sent by redirecting the output to a file:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;lynx -dump <A HREF=" TARGET="_new"> &gt;somefile.html <p>Cédric CHERCHI<br><a href=mailto:pochacco@francemail.com>pochacco@francemail.com</a><br><a href= > </a><br>PHP/MySQL<br>
JavaScript<br>
Flash 4 scripting<br>
HTML/DHTML
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top