I have a php script that connects to an external API returns some data and updates a database table. I can run this directly via my command line / SSH terminal and it works fine (takes about 5 minutes to complete).
Using crontab I have 'cronned' this script so it runs every three hours using the command below:
0 */3 * * * /usr/bin/php /var/acme/cron/api_update_db.php
Using the syslog I can see that this cron has run, but it would appear that the cron is actually running every three hours as expected however the database doesn't appear to have been updated? But when I run the exact same script manually myself by navigating to that directory & entering the following it runs (and updates the DB)
Would there be a reason for this executing differently when running from the cron job then when run manually from the terminal (which appears to work).
system()calls inside your php script then you need to provide absolute path to binaries you are calling.