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

How do I backup a MariaDB - MySQL Database?

In the control panel, within Backup section, under Download a SQL Database Backup will be your...

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...

403 Forbidden error with Drupal after install.

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

Register Globals On

If you run a script that requires php "register globals on" create a php.ini file and include the...

Learn MySQL

If you do not know how to use MySQL there are some great guides at the following websites....