Can anybody help me with setting up a cron job to run a PHP file.

Here is the code that I inserted in the PHP file:

#!/usr/local/bin/php
<?php

include_once "connect_to_mysql.php";

Here is the code that I used in the command line in the control panel:

*/5 * * * * php home/user_name/public_html/path/to/file.php

Thank you

Generally, webhosts provide this option.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.