HOWTO Run Scheduled Tasks From PHP Command Line

From Cerberus Helpdesk Wiki

Jump to: navigation, search

The ideal way to run scheduled tasks is by using a command-line HTTP client like wget or lynx --source. In certain shared hosting environments, sometimes you aren't able to use these tools since you can only configure cron jobs from control panel software and you're limited by what exists already.

If you're able to locate the PHP executable for command line scripts (e.g. /usr/bin/php) then you could set up a script like the following:

cron.php:


Save that script somewhere outside your web path (so visitors can't force your cron to run or see the output). Then set up your cron job to run it:


Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox