Use CURL, WGET, or PHP command-line interpreter.
A common method for running PHP scripts from a cron job is to use a command-line program such as curl or wget. For example, the cron job runs a command similar to the following command:
In this command, curl retrieves the web page, which then runs the PHP script.
However, there is a better way to run PHP scripts on your web site from cron jobs. You can run the script directly by using the PHP command-line interpreter. This method is just as effective, and usually faster. The following command shows how to run a script using the PHP command-line interpreter:
/usr/local/bin/php -q /home/username/public_html/script.php
In this example, the PHP command-line interpreter runs the script.php file. The -q option enables quiet mode, which prevents HTTP headers from being displayed.