Take the 2-minute tour ×

I have setup a cronjob in etc/crontab file as shown below

*/1 * * * * root /var/www/html/crons/check-solr.php

The above line runs a php script after every minute.

I have the stopped the cron using service crond stop and then again started the cron. But it did not run. The script is not running. please let me know if I am missing anything.

Regards Anil

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

in order for the script to run, it must have execute rights.

chmod +x /var/www/html/crons/check-solr.php

keep an eye on your logs in case there is an error

share|improve this answer
add comment

Sorry for replying to such an old Q.
You can't (usually) run PHP scripts directly from the command line by just typing the path to the .php file.

You need to run the PHP executable then specify your .php file as the file to parse/run... http://www.php.net/manual/en/features.commandline.usage.php

*/1 * * * * php /var/www/html/crons/check-solr.php

That should do the trick.
I run PHP CLI scripts with cron all the time, I find it's often the easiest way to accomplish some tasks quickly and pretty portable.

share|improve this answer
thanks for your reply...but I have already resolved this issue... –  Johny Aug 14 '12 at 11:27
add comment

Your Answer


