任务计划程序在 Windows 服务器上无法正常工作
我试图设置一个 cron 来在我的 Windows 服务器上运行 php 脚本。该脚本在手动访问时工作正常,但无法通过任务计划工作。
问题是:
// Code to fetch stuff from db
mysqlqueries...
for loop{
// Mail according to fetch content
mail function
}
// Mail a status report at the end to me.
我收到了状态报告,但没有其他任何东西,我的服务器在 godaddy 上,当我与支持人员聊天时,他们说 php 中有“运行 crons 的特殊语法”?这是我第一次听说这样的事情。有人可以帮忙吗?
I was trying to setup a cron to run a php script on my windows server. The script is working fine when accessed manually but it doesn't work via the task schedule.
Here is the problem:
// Code to fetch stuff from db
mysqlqueries...
for loop{
// Mail according to fetch content
mail function
}
// Mail a status report at the end to me.
I am getting the status report but nothing else, my server is on godaddy and when i chatted with support they said there is "a special syntax for running crons" in php? This is the first time i have heard about such a thing. Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够解决这个问题,代码中不需要进行任何更改。我只需在 cron 调用中从 php.exe 更改为 php-cgi.exe 即可。
I was able to fix the issue, nothing needed to be changed in the code. I just had to change from php.exe to php-cgi.exe in the cron call.