简体   繁体   English

PHP max_execution_time显示错误的值

[英]PHP max_execution_time Shows Wrong Value

I'm using the following to display the max_execution_time of the servers PHP settings: 我正在使用以下内容显示服务器PHP设置的max_execution_time

echo 'max_execution_time = ' . ini_get('max_execution_time') . '';

It returns the value as 0. 它将值返回为0。

However, when I check phpinfo() it shows the value is 30 . 但是,当我检查phpinfo()它显示的值为30

Can anyone suggest why ini_get isn't returning the correct value? 任何人都可以建议为什么ini_get没有返回正确的值? All other settings return the correct value. 所有其他设置将返回正确的值。

Using php 5.3.28 . 使用php 5.3.28

Many thanks. 非常感谢。

The ini_get() function returns the value stored in the php.ini of a certain parameter. ini_get()函数返回存储在某个参数的php.ini中的值。

The phpinfo() returns the current used values of all available parameters. phpinfo()返回所有可用参数的当前使用值。

The max_execution_time parameter probably does not appear in your php.ini file, and thus the response of the ini_get() function will be 0 , however this parameter is mandatory for php and have a default value of 30 seconds if not defined in the php.ini max_execution_time参数可能不会出现在你的php.ini文件中,因此ini_get()函数的响应将为0 ,但是这个参数对于php是必需的,如果没有在php.ini定义,则默认值为30秒php.ini

for more information read: http://www.php.net/manual/en/function.set-time-limit.php 欲了解更多信息,请阅读: http//www.php.net/manual/en/function.set-time-limit.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM