Cron Job not works calling a PHP file
I try to run a php file from a cron but this not work
sudo service cron status
cron start/running, process 1447
- 12,19 * * * /usr/bin/php5 /var/www//html/folder/phpscript.php > /var/log/file.log
I test with differents setups but none worked.
- 12,19 * * * /usr/bin/php /var/www//html/folder/phpscript.php
- 12,19 * * * php /var/www//html/folder/phpscript.php
- 12,19 * * * curl -k https://domain.com/folder/phpscript.php
- 12,19 * * * wget https://domain.com/folder/phpscript.php
When run the command over sheel it works:
Even when I setup a cron like * * * * * echo ‘This is a test’ > /var/log/file.log, it works.
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.