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


Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

Clean - Shrink ibdata1

To shrink ibdata1 once and for all you must do the following: MySQLDump all databases into a...

How can I parse .html as .php?

Create an .htaccess file and upload it to the root of your public_html directory. Include the...

Warning: Unknown(): open_basedir restriction in effect.

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

403 Forbidden error with Drupal after install.

Remove the following lines from the .htaccess file... Options -Indexes Options FollowSymLinks...

Error 500 - Internal Server Error - PHP

This can be due to several factors. The first thing to check is that the permissions on the file...