3

I'm using the following to display the max_execution_time of the servers PHP settings:

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

It returns the value as 0.

However, when I check phpinfo() it shows the value is 30.

Can anyone suggest why ini_get isn't returning the correct value? All other settings return the correct value.

Using php 5.3.28.

Many thanks.

2
  • 2
    Make sure it is not override to 0 for that specific project by setting it in config or .htaccess file. Commented Feb 5, 2014 at 9:34
  • Also make sure there is no ini_set for max_execution_time before that. Commented Feb 5, 2014 at 9:35

1 Answer 1

1

The ini_get() function returns the value stored in the php.ini of a certain parameter.

The phpinfo() returns the current used values of all available parameters.

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

for more information read: http://www.php.net/manual/en/function.set-time-limit.php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.