Knowledgebase - PHP as a Cron CentOS/Fedora

Our Client Portal

Portal Home > Knowledgebase > Dedicated Servers > PHP as a Cron CentOS/Fedora

PHP as a Cron CentOS/Fedora

When adding a PHP script as a cron you need to ensure that you include the full PHP directory, simply running the following will not allow the script to run:

30 6 * * * php -q public_html/clients/scripts/mycron.php

Using the following will allow the PHP script to be used within a cron process:

30 6 * * * /usr/local/bin/php -q /home/username/public_html/clients/admin/mycron.php

Note how we need to utilise the full directory structure to ensure both the PHP process is called correctly and has the full directory of your PHP script.

Add to Favourites Add to Favourites

Was this answer helpful?

Print this Article Print this Article

Also Read

Recent News
Knowledgebase Articles
Transferring email accounts from one cPanel server to another is a simple proces...
It is now possible to temporarily suspend the monitoring of Managed Dedicated Se...
Please Note: In order to reset your Centos password you will need KVM access to ...