donglangtun1850 2018-07-04 08:31
浏览 86

phpinfo()显示无效值

test.php

<?php
sleep(45);
phpinfo();

upon executing above code, after 47 sec, i'm getting response :

max_execution_time 30 | 30

strange but yes phpinfo() showing invalid timeout value.

upon sleep(75);phpinfo(); after 61 sec I'm getting request timout error in browser.

Problem: Not sure why phpinfo() is showing invalid value?

PHP Version: 5.6.29
Server API: FPM/FastCGI
php-fpm:    active
NGINX_VERSION:  1.11.8; linux

from above tests, it seems, server max_execution_time is 60 sec but its showing 30sec in phpinfo();

  • 写回答

2条回答 默认 最新

  • doubai9014 2018-07-04 08:34
    关注

    No, this is entirely expected. sleep() is blocking call. PHP doesn't know it has timed out until the execution thread is scheduled by the OS.

    Try:

    for ($x=0; $x<30; $x++) sleep(2);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号