Automating PHP Scripts Using Cron (Without CLI)

This is post is now quite old and the the information it contains may be out of date or innacurate.

If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub

A lot of hosting accounts do not have CLI PHP enabled. If you have some maintainence scripts that you want to run on a regular basis then you can still do this using cron combined with cURL.

For example check out this crontab command:


# 0 0 * * * * /usr/bin/curl http://www.mydomain.co.uk/currency_update.php

This will run the currency update script every night.

To edit your crontab simply log into the server via SSH and then type the following command:


crontab -e

Hit [i] to go into insert mode. Then type your command. Then hit [esc] to get out of insert mode. Finally type :wq to save the changes and quit.

If your command is not right, you will get a message saying so with an option to try again at editing the file.


Tags: edmondscommerce