increase php max_execution_time in IIS 7.5

寵の児 提交于 2021-01-27 21:54:56

问题


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


回答1:


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




回答2:


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

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




回答3:


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.



来源:https://stackoverflow.com/questions/25678787/increase-php-max-execution-time-in-iis-7-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!