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 can I find my MariaDB - MySQL version?

Login to cPanel In the "Stats" section on the left, locate the row labeled "MariaDB or MySQL...

Test MySQL Connection

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

How do I backup a MariaDB - MySQL Database?

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

PHP information

To view your current version of PHP you will create a php file, for example info.php, and place...

What version of PHP do you use?

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