Creating a cron job in php
I want to create a cron job which has to 开发者_开发知识库execute a file every 30 minutes or regular interval. I don't have a cpanel or any front-end to do that.
How do I do it?
You can't. This is an OS level function not PHP level. Best bet is to email your host and ask them if it's possible to setup a cron for you.
If the user as whom the webserver runs is allowed to have cron jobs, and the system is correcty set up, then its simply a matter of executing the cron program (popen, exec, system....etc) and feeding it an appropirate input file. However on any sensibly configured, internet connected webserver, the httpd user will NOT be allowed to run cron jobs.
There are tools like pseudocron but be careful.
C.
Psuedocron may help.
精彩评论