doutu9810 2015-05-03 12:51 采纳率: 0%
浏览 43
已采纳

PHP:从cron运行脚本时路径不正确

I'm having a strange problem. When I call script with http request (from browser) it works as it should. But when I'm calling it with cron include starts complaining on paths. Why can paths be ok while running the script in a common way an incorrect in cron? I've tried to use absolute paths, but it did not help.

  • 写回答

1条回答 默认 最新

  • dongyo1818 2015-05-03 13:22
    关注

    In my case I solved this with a code like this:

    include_once __DIR__ . '/DB/mysql.php';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?