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

Premature end of script headers

If you receive an Internal Server Error 500 and checking your log files displays "Premature end...

Useful CSV to MySQL Script

Provided below is a great tool we have run into for converting CSV files into MySQL format: CSV...

Clean - Shrink ibdata1

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

When trying to connect to MariaDB or MySQL you receive error 2003 Cannot connect to MySQL on x.x.x.x on port 3306 (10060)

Please ensure you have added the remote IP to the allow list in your hosting control panel...

Internal Server Error with PHPList

PHPList produces internal server error. Checking error logs results in: Invalid command...