I have this cron job on my server that runs this PHP script every 30 minutes. The Cron job looks like this:
*/30 * * * * wget https://example.com/cron.php -O /var/log/cronerror.txt
The Cron job works, the PHP script does several things (send email, update database etc) and this is working fine.
What is not working is a part of the script using simplexml_load_file
loading an external URL. Opening this URL is supposed to send a SMS-message.
When I open the script in my browser, the SMS-message is sent and everything works. But when the cron job executes the script, it is not sent. Seems like it cant open URL through simplexml_load_file
. Any ideas why/other solutions?