test.php
<?php
sleep(45);
phpinfo();在执行上述代码后,在47秒之后,我将得到响应:
max_execution_time 30 - 30
奇怪但是的phpinfo()显示无效的超时值。
在sleep(75);phpinfo();上,在61秒之后,我在浏览器中得到请求超时错误。
问题:不确定为什么phpinfo()显示无效值?
PHP Version: 5.6.29
Server API: FPM/FastCGI
php-fpm: active
NGINX_VERSION: 1.11.8; linux从上面的测试来看,服务器max_execution_time似乎是60秒,但是它在phpinfo()中显示了30秒;
发布于 2018-07-04 08:34:22
不,这完全是意料之中的。睡眠()正在阻塞呼叫。PHP不知道它已经超时,直到操作系统对执行线程进行调度。
尝试:
for ($x=0; $x<30; $x++) sleep(2);发布于 2018-07-04 08:35:09
<?php
set_time_limit(300)
sleep(45);
phpinfo();用max_execution_time ()函数设置新的set_time_limit
https://stackoverflow.com/questions/51169205
复制相似问题