Php – Cronjob not executing only *one* php script

cronPHP

Okay, I have a php script that has to be executed each 15 minutes, but that does not work. My other scripts just get executed just fine, and I can execute it via the command line.

# m h  dom mon dow   command
30 2 * * 1 /usr/bin/letsencrypt renew >> /var/log/le-renew.log
* 10 * * 0 php /var/www/html/slack/huiswerk_reminder/runner.php
* 17 * * 1 php /var/www/html/slack/huiswerk_reminder/runner.php
* 17 * * 2 php /var/www/html/slack/huiswerk_reminder/runner.php
* 14 * * 3 php /var/www/html/slack/huiswerk_reminder/runner.php
* 16 * * 4 php /var/www/html/slack/huiswerk_reminder/runner.php
*/15 * * * *  php /var/www/html/slack/cijfercheck/cijfercheck.php

Only */15 * * * * php /var/www/html/slack/cijfercheck/cijfercheck.php wont get executed. What am I doing wrong??

Steps I have taken to try fix it:

Change */15 to 0,15,30,45

And looked at all these questions:
https://stackoverflow.com/questions/32393740/cronjob-not-executing-php
https://stackoverflow.com/questions/5784573/cronjobs-not-executing-php-scripts-no-mailto-warnings-received
https://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work
https://askubuntu.com/questions/93313/cron-job-not-running
Why is my crontab not working, and how can I troubleshoot it?

It all does not work, and the weird thing is, the others work just fine, no problem at all…
So what am I doing wrong?

Best Answer

You need a blank line at the end of your crontab, or it won't work. Also try adding #!/bin/bash before your scripts to ensure they run in BASH, rather than some other shell.

If that doesn't work, then you can try offloading to a .sh script:

*/15 * * * * $HOME/sched.sh >> $HOME/log_sched 2>>$HOME/error_sched

then you fill it out as a BASH script:

#!/bin/bash

php5 /var/www/html/slack/cijfercheck/cijfercheck.php &&

echo FINISHED AT $(date +"%T")