How to set cron in to run PHP file on localhost in Ubuntu?

  1. Open crontab in your terminal:EDITOR=gedit crontab -e
  2. Add your cron settings at the end of your file (we are setting cron to be execute in every 2 minute in our example):*/2 * * * * /usr/bin/php -q /path/to/phpfile.php > /dev/null
  3. Save your cron file and run:sudo service cron restart

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *

PAGE TOP
error

Enjoy this blog? Please spread the word :)

RSS
Follow by Email