【发布时间】:2020-06-29 07:19:44
【问题描述】:
我使用 shell_exec 从命令行运行 Python 脚本,进行测试,Python 脚本只是在等待 一段时间后返回True:
def test(minutes):
import time
time.sleep(minutes*60)
return True
根据我的测试,如果时间段是 30 分钟或 60 分钟,则结果成功返回给 PHP,但是如果我将其设置为 80 分钟,则 PHP 没有收到任何结果,甚至没有错误消息。
php.ini 中的 max_execution_time 是 30000 秒,足够长了。
环境:带有 IIS 的 Windows Server 2016 Standard
PHP 版本:7.3.4
【问题讨论】:
-
返回“什么”?您的 php 引擎“如何处理布尔类型(包括系统设置)”。不能将 Web 服务用作 crontab !
标签: python php shell-exec