I have a script that I want to run everyminute. I understand how to set the timings of it, I've set it as:

*/5 * * * *

My script that I want to execute is at /var/www/html/domain.co.uk/content/inc/download-feed/banter.php

Would I just have my crontab entry as:

*/5 * * * * /var/www/html/domain.co.uk/content/inc/download-feed/banter.php

Or is there something else I need to add to it?



Your cron won't run every minute (instead it will run every five minutes).

Usually, the system does not know what to do with a .php-file. So you have to use the php-interpreter and the file as argument for it:

*/5 * * * * /usr/local/bin/php -f /var/www/html/footy-feed.co.uk/content/inc/download-feed/banter.php

or if you want to run it every minute:

* * * * * /usr/local/bin/php -f /var/www/html/footy-feed.co.uk/content/inc/download-feed/banter.php

Please note: the path "/usr/local/bin/" can be different on your system.

| improve this answer | |
  • Thank you very much! And yeah I realised after I typed /5 after the first 'every' by accident :) – Probocop Jul 8 '10 at 15:06

You'll need the full command, so you are basically missing the php interpreter in the code code you posted. Replace



/usr/local/bin/php -f \

If your php executable live somewhere else, you'll need to adjust /usr/local/bin/php.

| improve this answer | |

It depends whether you have the PHP commandline interpreter installed, and whether the code inside your PHP script will just run by itself.

If it's just a piece of PHP you'd normally run from a web browser, it might not work. What's inside it?

| improve this answer | |

If you want to process it with PHP, you better run it with:

*/5 * * * * php /var/www/html/domain.co.uk/content/inc/download-feed/banter.php
| improve this answer | |

Check if you have executable rights on the script file. Make sure you don't edit the /etc/crontab, but use crontab -e so the config will be saved.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.