Question
Cronjob not running php script
I set up cronjob with following command:
sudo crontab -e
I tried following statements for cronjob but it doesn’t work:
30 2 * * * php -q /path/to/php/script.php
30 2 * * * /usr/bin/php /path/to/php/script.php
30 2 * * * /usr/bin/php -q /path/to/php/script.php
But when I tried the GET method as follows, it works:
30 2 * * * wget http://my.domain.com/path/to/php/script.php
I have a LAMP setup Ubuntu 12.04 (64-bit) system with my PHP version manually upgraded from 5.3 - 5.4 to run modules on my WHMCS installation.
Any idea what’s going wrong while running with PHP mode? I don’t want to use GET method!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×