dongle2627 2018-08-09 12:32
浏览 32

simplexml_load_file不能与cron作业一起使用

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算
    • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
    • ¥20 有人知道这种图怎么画吗?
    • ¥15 pyqt6如何引用qrc文件加载里面的的资源
    • ¥15 安卓JNI项目使用lua上的问题
    • ¥20 RL+GNN解决人员排班问题时梯度消失