Reputation: 70
I have an php file to create a new text file . That has to run in every minute . I stored that file on /var/www/html/cron.php
. Also i had done in command prompt
crontab -e
edit the file like
* * * * * /var/www/html/cron.php
But still cron not working on localhost
Upvotes: 0
Views: 1700
Reputation: 4983
you need to specify in the cron the command to execute, i.e
[cron time] [command to execute]
/var/www/html/cron.php
is not a command just a file, you need to use something like
* * * * * php /var/www/html/cron.php
*better to use full path of php bin instead of php
Upvotes: 3
Reputation: 5748
The command you put in crontab should be something like:
*/10 * * * * /usr/bin/php /var/www/html/cron.php
Where /usr/bin/php
is an example path to your php
binary.
You can find out your php binary
with:
whereis php
Upvotes: 1