View Complete Thread
  • Re: PHP Configuration Issue

    Jun 11, 2013 06:53 PM|szarkos|LINK

    This sounds like it could be an execution timeout issue.  Can you check how long it takes from when you access the page (or click "submit" or whatnot) to when you receive the 500 error.  If the timing is consistent that usually suggests a timeout issue.

    I would recommend checking the following:

    • I see that you have set PHP's max_execution_time, post_max_size and memory_limit parameters.  These are the correct settings to check, and their settings look OK to me.  Can you also double-check that the php.ini file is being read properly?  An easy way to do this is to create a simple php script that looks like the following somewhere in your web root (perhaps call it phpinfo.php or something):

      <?php  phpinfo();  ?>

      Then request that file from your browser.  In the output of phpinfo you will see a parameter called "Loaded Configuration File".  This will point to the php.ini file currently used by IIS.  The phpinfo output will also contain all the parameters you set in your php.ini, so you can then search through this file and ensure that the above parameters are also set to your new values.  Good to check these too since unless you're running with startup_errors enabled you may not see warnings related to invalid parameters or typos.

      Also, to be safe, be sure to move or remove that phpinfo file before going to production.

    • Next, check your FastCGI Settings in IIS manager.  In the FastCGI Settings, click on the appropriate PHP entry and then click "Edit".  Then scroll down to "Request Timeout".  This is set to 90 seconds by default, but if your uploads sometimes take longer then you will see an error.  Change this to a higher value and then restart IIS.

    IIS has other timeouts as well (such as ConnectionTimeout which is set to 120 seconds by default), but if your uploads work with ASP and not with PHP that seems less likely to be the issue.