I'm trying to execute a php script via cron. The script works fine run through the browser. The file is chmod 755. The cron file is
# m h dom mon dow command
* * * * * /opt/bitnami/apache2/htdocs/myscript.php
I have verified cron is running using
bitnami@ip-12-345-789-012:/usr/local/bin$ ps aux | grep cron
root 496 0.0 0.1 2400 916 ? Ss Nov03 0:00 cron
EDIT: I have fixed by changing crontab file to
m h dom mon dow command
* * * * * /opt/bitnami/php/bin/php /opt/bitnami/apache2/htdocs/myscript.php
I am curious what the difference is supplying the path to php this way or via a shebang in the script? are they equivalent or do I misunderstand?