2

I'm trying to increase the max_execution_time value in PHP(5.5) running on IIS 7.5 (Windows Server 2012).

phpinfo() shows max_execution_time=300 regardless of what I tried. Some Internet sources mentioned that this value is overridden by something in IIS.

Based on Internet searches, I've tried the following:

  • Edited max_execution_time in php.ini to 1200 then restarted server - no effect
  • Changed CGI->Behavior->Time-out to 1200 then restarted server - no effect
  • Put "ini_set('max_execution_time', 1200);" above phpinfo(). This actually had some effect. The page shows the "local" value is 1200 while the "master" value is still 300.

I can understand that the third option worked because it is in the same script and immediately above the phpinfo() line and therefore has the highest priority. However, I'm looking for a server-wide configuration. I have a feeling that it's possible, and that I'm not looking in the right place.

Can someone point me in the right direction?

Thanks

nanytech
  • 398
  • 3
  • 10

3 Answers3

3
C:\Program Files\PHP\v7.0\php.ini

search for: "[WebPIChanges]" there should be "max_execution_time=300" change that record.

Dmitriy
  • 5,525
  • 12
  • 25
  • 38
Marcin Jaworski
  • 330
  • 2
  • 9
2

After rereading each line in php.ini, I found another section at the very bottom of the file that was named [WebPIChanges] and contained a bunch of "overrides". I'm guessing this is from the Web Platform Installer.

Tweaking that value solved it for me.

I'll leave it up in case anyone runs into the same issue.

nanytech
  • 398
  • 3
  • 10
0

Please check for a hidden .htaccess file on your server and if there is no .htaccess file then you can create one( make sure that there is no hidden htaccess file otherwise it will overwrite) and paste this code.

php_value max_execution_time 259200

You can also refer this url Increase max execution time for php

Community
  • 1
  • 1
Parth Kumar
  • 179
  • 4
  • Thanks for the input. There isn't any .htaccess file on the site except one file called phpinfo.php. – nanytech Sep 05 '14 at 05:49
  • 1
    The problem Apache has PHPIniDir tag in its httpd.conf file. The tag is ignored by PHP version 4.x, but version 5.x uses it. It pointed to C:\PHP instead of C:\WINDOWS. So, it was looking for PHP.INI in C:\PHP, but there was none, so it used default values, but PHPINFO() worked like in version 4.x, so it reported correctly PHP.INI in C:\WINDOWS ... You can track the location of php.ini by phpinfo() and update it in the right php.ini file. – Parth Kumar Sep 05 '14 at 07:54
  • Thanks Parth. I finally figured it out. Looks like Web Platform Installer created a separate section with a bunch of overridden variables including max_execution_time – nanytech Sep 08 '14 at 20:50
  • 2
    The OP asked about IIS, not Apache. – Mike Godin Nov 02 '18 at 16:49
  • 1
    IIS doesn't use .htaccess files – PeteB May 20 '20 at 12:48