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

Error: SoftException in Application.cpp:303 UID of script is small than min_uid

Error: SoftException in Application.cpp:303 UID of script is small than min_uid when going...

Could not connect to the MariaDB - MySQL database

You will want to verify you are using the correct database name, username and password. All...

Warning: Unknown(): open_basedir restriction in effect.

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

Test MySQL Connection

The following is a great way to verify a MySQL / MariaDB database connection issue. Create a file...

Warning: system() has been disabled for security reasons

system is a feature of php which is disabled by default. To change this if needed for a...