Running PHP file using crontab
问题 I need to run a PHP file every 1 hour. What I'm doing is: sudo crontab -e (In the editor) * 01 * * * /usr/bin/php /var/www/devicecheck.php But somehow, it's not working. The command works on the command line. Before this, I was trying php /var/www/devicecheck.php Any suggestions? 回答1: To execute devicecheck.php every 1 hour try the following: Method A :: Execute the script using php from the crontab # crontab -e 00 * * * * /usr/bin/php/var/www/devicecheck.php Method B: Run the php script