PHP Hello world Cron Job in Cpanel (step by step explained)

(Last Updated On: August 11, 2016)

PHP Hello world Cron Job in Cpanel (step by step explained)

Step 1: Login to cpanel and click the Cron Jobs.

cron job

Step 2: Choose the Cron Job (repetions like every 5 minutes, one hour once, one day once etc..,)

cron repetitoin

Step 3: Give the command like this in the above image,

php -q -f /home/YOUR_LOGIN_NAME/public_html/croncheck.php

Step 4: croncheck.php contains simple echo,

<?php
echo "cron job running";
?>

Step 5: We will be getting the email if we have configured the cron email in the Cron Jobs.
For the above program we will get email with the subject,

"Cron Job running"

PHP Recommended Books:

253 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *