Cron Jobs with PHP Files

How do I run a php file using Cron jobs?

 

From the cPanel, click the Cron Jobs icon and enter the following into the Command field:
  /ramdisk/bin/php5 -c /home/USERNAME/PathTo/php.ini /home/USERNAME/public_html/PathToFile
You may also want to adjust the settings specifying when to run the cron job.

Note: You will need to replace USERNAME with your user ID and PathToFile with the file name or the rest of the path to the file.

Note: You may need to adjust /home/ to /home#/ depending on the home directory your account resides on. To view the home directory for your account simply view the stats column on the main cPanel page of your account and look for the home directory.

Note: To specify the php.ini file to use you may add "-c /home/USERNAME/PathTo/php.ini" to the cron job entry.

  • 21 Users Found This Useful
Was this answer helpful?

Related Articles

Configuring the PHP Environment With php.ini

Problem: How do I change the PHP environment for my site with php.ini? Solution:   To...

PHP with FastCGI

Problem: What is FastCGI for PHP? Solution: FastCGI for PHP makes all your PHP applications...

Upload_Max_Filesize

Problem: How do I change my upload_max_filesize? Solution: Summary Locate the php.ini...

Basic Site Security Checklist

Remove malicious files and/or files you are not familiar with. While many PHP applications...

IonCube Installation

Problem: How do I install Ioncube into a Free1Host hosting account? Solution: Ioncube is...