I need to set cron jobs for a PHP application. Which is the right command syntax to use?

Created:

2017-06-05 05:16:58 UTC

Modified:

2017-06-25 21:45:59 UTC

0

Was this article helpful?


Have more questions?

Submit a request

I need to set cron jobs for a PHP application. Which is the right command syntax to use?

Applicable to:

  • Plesk for Linux/Unix

Resolution

If you specify the path to the PHP file, the system will run it as CGI. This may cause some problems with paths or ownerships.

It is better to execute PHP scripts in Apache environment by accessing them via 'curl' or 'lynx' or any  other shell based web browser. For example the record in crontab may looks like:
0 * * * * curl http://domain.com/script.php > /dev/null 2>&1
Have more questions? Submit a request
Please sign in to leave a comment.