Run a PHP file in a cron job using CPanel

Zabs picture Zabs · Sep 7, 2011 · Viewed 221k times · Source

I am just trying to run a PHP script using a cron job within CPanel - is this the correct syntax:

/usr/bin/php -q /home/username/public_html/cron/cron.php >/dev/null

I am not getting any email notifications stating a cron has been completed, do I need to do anything specific with the PHP file?

Answer

Pank picture Pank · Mar 13, 2012

I used this command to activate cron job for this.

/usr/bin/php -q /home/username/public_html/yourfilename.php

on godaddy server, and its working fine.