Question:

How do I run a PHP file from a crontab?

by  |  earlier

0 LIKES UnLike

I know how to do cran jobs, but I'm not sure about executing php files?

 Tags:

   Report

2 ANSWERS


  1. Whenever you run the cron job, just put php in front of the path to the file.

    E.G.

    php /var/www/html/cron.php


  2. If what you are trying to do is simply execute a PHP page then you should take a look at the curl function.

    Use it in this fashion:

    curl -s http://www.mywebcards.net/demo/tools/del...

    The -s option means silent and there are loads and loads of configuration options. Just look at the manual at http://curl.haxx.se/docs/manpage.html

    This is also compatible with the cron jobs in Cpanel

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.