FastCGI problems make PHP-sites crash running in IIS 10RSS

7 replies

Last post Dec 04, 2017 03:01 PM by lextm

  • FastCGI problems make PHP-sites crash running in IIS 10

    Nov 30, 2017 03:34 PM|RolfSnijd|LINK

    Hello expert,

    As I have ASPX-sites as well as PHP-websites, I run both flavours on my webserver IIS 10 on Windows 10 prof 32bit, latest update.

    That seems to give no problems, but the last few months I have many crashes of my PHP-sites.

    I can trace these crashes and hanging of sites to FastCGI problems.

    A summary:

    Recently, my websites running (on the same 32-bit IIS webserver) under PHP version 7.1.7 crash many times (Internal Server Error 500), or are 'frozen' in a process (Loading data...) which does not end.

    The Internal Server Error is traced back to a FastCGI problems/failures: "FastCGI exited unexpectedly".

    Sometimes, refreshing the browser-window (F5 or ctrl-R) helps, but often I have to restart my webserver entirely (hard-reboot).

    Error message:

    "HTTP Error 500.0 - Internal Server Error. The FastCGI process has failed frequently recently. Try the request again in a while."

    A. Example Piwigo (online photo album showcase):

    Clicking in album categories of Piwigo and on individual photo's for detail-page cause the same FastCGI error message.

    This happens especially when handling GIF-animations, which are resized on the fly by the Imagick-plugin.

    (The website also contains the PicLens 3D Wall plugin [Adobe Flash]).

    The Imagick-plugin in Piwigo needs C++ runtime:

    This will not work in combination with the latest version: Microsoft Visual Studio C++ 2017 Redistributable (x86) 14.10.25017

    This may work with: Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.23026 , but often results in 'frozen' webserver.

    B. Example Piwik (web-statistics analysis): 

    Clicking on the webpages of Piwik, navigation towards a monitored website:

    Piwik: Settings | Websites | Manage -->

    Piwik-site page gets stuck in 'Loading data...' or displays error message:

    "HTTP Error 500.0 - Internal Server Error. The FastCGI process has failed frequently recently. Try the request again in a while."

    The statistically calculated content of the Piwigo-site (visitor activities) is often blanc in Piwik detail-pages, and sometimes filled with appropriate data.

    ---

    Overal performance: these PHP-sites have become slow and unpredictable.

    (As webbrowser, I used the updated versions of: Edge, Firefox and Opera.)

    Do you know what could be the main cause of this FastCGI problem?

    Do you know what the correct combination/implementation/settings should be, to get these websites working properly, 

    regarding versions of: Piwik, Piwigo, Imagick, Visual C++ Redistributable, PHP - FastCgi ?

    Or may the cause be: recent updates / upgrade of Windows 10 this year?

    (At the moment: 2017-11 Cumulative Update for Windows 10 Version 1703 for x86-based Systems.)

    Environment PHP-sites: 

    Piwigo 2.9.2 (www.rolfsnijders.net)

    Piwik 3.2.0 

    Operating system: WINNT: Windows 10 prof 32bit, webserver: IIS 10 

    PHP: 7.1.7 [2017-11-21]

    MySQL: 5.5.54 

    Imagick Graphics Library: External ImageMagick 7.0.5-1

    Installed on webserver: 

    a) ImageMagick-7.0.5-1-Q16-x86-dll.exe (desktop software).

    b) Relevant content of: php_imagick-3.4.3rc4-7.1-nts-vc14-x86.zip (PHP-extension).

    Friendly regards,

    Rolf

  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 01, 2017 03:17 AM|lextm|LINK

    If it was php-cgi.exe who crashed, then it has little to do with IIS,

    https://blog.lextudio.com/who-should-be-contacted-for-php-on-iis-issues-c80b90bd365

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 01, 2017 06:48 AM|Yuk Ding|LINK

    Hi RolfSnijd,

    First of all, you need to check whether both application pool identity(IIS Apppool\<apppoolname> and authenticated user like IUSR has the read/write permission to access the files. Secondly , you could try to grant permission to the c:\windows\temp. You could  use php -v to check whether the PHP configuration has been configured correctly.

    If the steps above not working, maybe it is not an IIS fast-cgi configuration error but an application error in IIS fast-cgi pipeline. So maybe you need to check your PHP code or consult the PHP forum.

    Best Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 04, 2017 07:59 AM|RolfSnijd|LINK

    Hello Yuk Ding,

    Thank you for your answer and advice.

    A. About IUSR: I thought this IIS-user is obsolete/deprecated in Windows IIS 10.

    I also see other Windows-users (via Permission Entry for <...UNC:website...> Select User or Group), such as:

    ASP.NET, IIS_IUSR, IIS_WPG, and IUSR, but no Windows-users with the name of a site, generally: IIS (Apppool\<apppoolname>).

    But all these sites do have a Windows user-profile/account in c:\users\ !?!

    B.a) I have tried, though, to initiate IUSR rights to my Piwigo-site from top-level folder and all sub-folders (parent/child + files: Replace all child permissions...).

    This led to many 'Access denied' message-boxes regarding all kinds of files within this website (sub)folders.

    Previously, IUSR had no rights at all on the piwigo-website (sub)folders, but now I gave the following Window-rights to IUSR (except for the Access Denied items):

    Read & execute+, List folder contents+, Read+, Write+ .

    One of these IUSR-rights seems to have a slight beneficial effect on the Piwigo-site: less errors (HTTP Error 500.0), but not completely resolved.

    b) I gave the same rights to my Piwik-site (also many 'Access Denied' on child-files).

    The result on this site is that the information on particular site-entities is still not updated properly (Continous message: "Loading data ...").

    C. I also gave IUSR these same rights (see above) to: c:\windows\temp .

    D. And I gave IUSR rights on: ..\PHP\v7.1\php-cgi.exe: Read+ , Read&Execute+ .

    Summary:

    I still keep on getting the message (or half-built pages in Piwik):

    HTTP Error 500.0 - Internal Server Error : ..\PHP\v7.1\php-cgi.exe - The FastCGI process exited unexpectedly .

    I still have no clue what exactly causes the problem: PHP v.7.1.7, CGI, Fastcgi, Piwigo, IIS 10 or Windows 10 update (Creator Fall), or collaboration of Windows with Open Source components.

    Friendly regards,

    Rolf

  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 04, 2017 08:05 AM|RolfSnijd|LINK

    Hello Lextm,

    How about: C:\Windows\System32\inetsrv\iisfcgi.dll

    That DLL is a Windows / IIS product ?

    Friendly regards,

    Rolf

  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 04, 2017 08:55 AM|Yuk Ding|LINK

    Hi RolfSnijd,

    I think it may not be an IIS issue, you may need to analyze something like asp.net dump file.  Then it should point you to the right place. PHP forum should be available for this.

    Best Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 04, 2017 10:55 AM|RolfSnijd|LINK

    Hello Yuk Ding,

    Regarding solving FastCGI problems: the fact is that the PHP-forum points to IIS-forum, and the IIS-forum points to PHP-forum frown.

    Greetings, Rolf

  • Re: FastCGI problems make PHP-sites crash running in IIS 10

    Dec 04, 2017 03:01 PM|lextm|LINK

    RolfSnijd

    How about: C:\Windows\System32\inetsrv\iisfcgi.dll

    I made it clear in the blog post that iisfcgi.dll is part of IIS,

    If you do observe a crash on iisfcgi.dll, open a support case via http://support.microsoft.com to see whether there are patches for that.

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.