You can run scripts in PHP at a specified time with the desired frequency. To do this you need to use a PHP-CLI interpreter.

Since not all PHP programs can run through the SAPI CLI without modification, you can run them through wget. For example:

/usr/local/bin/wget -O /dev/null -q http://mysite.tld/cron.php?action=123

If the script uses require functions, include them, and they indicate the appropriate paths, to start executing the script, use the chdir() call function, which sets the current working directory.

 

Was this answer helpful? 29 Users Found This Useful (97 Votes)