I have a php script that runs a curl command and retrieves data. afterwards I update the database with the data. This works fine for me when I execute the script directly but not when using crontab. My crontab line is:
* * * * * /usr/bin/php http://mydomain.com/script.php
When I use this through crontab I see the database updated but not the content received from the curl function. As well, If I try to run the php script from ssh it works fine as well.
Actually, I managed to work it out just now by adding
!/usr/bin/php
to the top of the php script. Im not exactly sure why did that fix the issue but now it is working.