CRON 作业不断出错
我们的 apache/whm 服务器上运行着几个 CRON 作业。我们正在使用 php。从浏览器运行时,这些脚本都可以正常工作。
cron 将抛出类似错误:无法包含文件(即使给出绝对路径)。
结果也会有所不同,损坏输出文件等。我真的很困惑,因为有时 cron 也能正常工作。看起来确实是断断续续的,当从浏览器执行时它们每次都能完美地工作。
任何帮助将不胜感激,干杯。
We have several CRON jobs running on our apache / whm server. We are using php. The scripts all work completely fine when run from the browser.
The cron will throw back errors like: unable to include files (even when giving the absolute path).
Results will also vary, corrupting output files etc. I am really baffled, as sometimes the crons work fine as well. Seems really intermittent and they work every time perfectly when executed from the browser.
Any help would be appreciated, cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如大家所指出的,PHP CLI 和 PHP Apache 模块是单独的软件,并且它们具有单独的配置文件。
不要在根 cron 选项卡上设置 crontab,而是确保所有权限都正确。使用他们将从 cron 运行的用户进行调试。假设您正在运行 Linux,则可以使用
它。
As everyone has pointed out, PHP CLI and the PHP Apache Module are separate software and they have separate configuration files.
Rather than set the crontab up on the root cron tab, make sure all your permissions are correct. Debug with the user they will run from cron as. Assuming you are running Linux, you can use
for this.