Running a PHP file with a cron job

To run a PHP file from cron, use the "cron jobs" section of your control panel. Use the following line and modify it for your account and filename and location:

php -q -f /home/username/public_html/location/script.php

  • 286 Users Found This Useful

Was this answer helpful?

Related Articles

Increase PHP Memory

Fatal error: Allowed memory size of xxxxxxxxx bytes exhausted (tried to allocate 1064256 bytes)....

InnoDB: Error: Attempted to open a previously opened tablespace. Previous tablespace

When receiving the error     "InnoDB: Error: Attempted to open a previously opened tablespace....

The MySQL server is currently offline. admin bin Cpanel/cpmysql/DBCACHE: exit 11

# This error shows in all user control panels via the "MySQL Databases" icon...   The MySQL...

What version of PHP do you use?

We use both PHP versions 4.4.x and 5.x.

Warning: Unknown(): open_basedir restriction in effect.

Basedir restriction is set for security. This most often occurs when you are calling an app...