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);
    
    评论

报告相同问题?