locked
C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly RRS feed

  • Question

  • User264827366 posted

    Hi,

    I am trying to run PHP via FastCGI on a Windows 2008 server. I followed this installation doc http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/ and have checked I completed the steps correclty numerous times. However when I try to execute a php page i am presented with the following error:

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

    Detailed Error Information

    Module: FastCgiModule
    Notification: ExecuteRequestHandler
    Handler: PHP via FastCGI
    Error Code: 0x000000ff
    Requested URL: localhost/test.php 
    Physical Path: C:\inetpub\wwwroot\test.php
    Logon Method: Negotiate
    Logon User: Domain\user

     I had PHP working correctly without using FastCGI so im fairly sure its not the PHP installation. The only help i have found on this error is here http://blogs.iis.net/rickjames/archive/2007/10/16/fastcgi-debugging-quot-the-fastcgi-process-exited-unexpectedly-quot.aspx and as I am a novice at debugging something like this im not finding it much help.

    I have changed the applictaionhost.config file locking down most sections as this server wiil be used for hosting, but i have doubled checked that the sites attempting to run php have access to all the modules and handlers they require i.e. the FastCGI handler shown above in the detailed error information.

    Any ideas on why this error may be happening, or any simple tips for debugging it?

    I am thinking a fresh install may be my only way of fixing this?

    *****Update*****

    After reading other posts I followed  these steps mentioned by ruslany

    "A possible way to isolate the problem is by running your script from the command line:

     C:\php\php-cgi.exe C:\inetpub\wwwroot\phpinfo.php

    If you get the same error then you will know that the error has nothing to do with web server or FastCGI module.

    Another thing to try is to switch php handler mapping from FastCGI to CGI and see if the error goes away. This way you will know that the error is caused by FastCGI."

    So I ran the script from the command line and it returned:

    -----------------------------------------------------------------------------------

    PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_gd.dll' - The specified module could not be found. in Unknown on line 0

    Hello World! 

    ----------------------------------------------------------------------------------

    I then switched the php handler from FastCGI to CGI and tried my php page using IE which returned the "Hello World" text followed by the php warning above

    So, bar the warning it appears to be working correctly. I dont think this warning is crashing FastCGI, however ill work on fixing it just to make sure.

     

    Thursday, May 15, 2008 11:13 AM

Answers

  • User264827366 posted

    ok i have finally got this working, i guess these turned out to be famous last words

    "I dont think this warning is crashing FastCGI, however ill work on fixing it just to make sure."

    The error was causing FastCGI to crash, i commented out extension=php_gd.dll in my php.ini and it appears to be working correcly.

    I think ill test this a bit more just to make sure.

     I hope this can help anyone else who has the same problem.

    Thanks

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, May 15, 2008 12:14 PM

All replies

  • User264827366 posted

    ok i have finally got this working, i guess these turned out to be famous last words

    "I dont think this warning is crashing FastCGI, however ill work on fixing it just to make sure."

    The error was causing FastCGI to crash, i commented out extension=php_gd.dll in my php.ini and it appears to be working correcly.

    I think ill test this a bit more just to make sure.

     I hope this can help anyone else who has the same problem.

    Thanks

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, May 15, 2008 12:14 PM
  • User2072887442 posted

    Hello,

    It looks like PHP extension folder is incorrect in the PHP.ini and because of this PHP cannot load the library. You start PHP from C:\PHP but it search for extensions in C:\Program Files (x86)\PHP\ext\.

    Set the extension_dir directive in PHP.ini to 'C:\PHP\ext' to resolve this.issue.

    BTW, you can try the installation that is described on the following page: WITSuite.com Knowledge Base / Manual PHP install - it works ok for me.

    Thursday, May 15, 2008 12:27 PM
  • User-1873277487 posted

    I hit this but then I ran into this page: http://www.thewebhostinghero.com/tutorials/windows2008-iis7-fastcgi-php.html. Which actually noted that a registry entry should be added for PHP: HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath = C:\PHP. After I created this, I got the Hello World and PHPInfo pages to run correctly.

    Thursday, December 18, 2008 10:06 PM
  • User2020892187 posted

     actually the problem in PHP.download php setup and zip file.first install setup and check extension directory and mysqli extension .if it is not work extract the zip copy the all file and paste .use the php.ini file from zip file check extension directory and uncomment mysqli extension

    http://www.technoweblog.com/featured/installing-wordpress-in-iis7

    Sunday, July 18, 2010 6:46 AM
  • User-1017453150 posted

    I spent all day trying to debug this issue and couldn't get it to work until I found your recommendation to run php-cgi from the command line. Thanks!

    For everyone else, my specific issue was that the php-cgi.exe was trying to access browscap.ini in the systems folder and didn't have the appropriate permissions. I was trying to install wordpress on a new server. Everything worked perfectly if I set it up through plesk to run ISAPI, but whenever I tried FastCGI I would get this error.

    Mike - www.ohrizon.com

    Tuesday, July 20, 2010 10:16 PM
  • User117207692 posted
    I've spent more than all day trying to resolve this without any luck. I've been through dozens of different sites and have followed their instructions very carefully without getting this error to go away. I'm still getting the following: HTTP Error 500.0 - Internal Server Error c:\php\php-cgi.exe - The FastCGI process exited unexpectedly Detailed Error Information Module FastCgiModule Notification ExecuteRequestHandler Handler PHP_via_FastCGI Error Code 0x000000ff Requested URL http://localhost:80/index.php Physical Path C:\inetpub\wwwroot\index.php Logon Method Anonymous Logon User Anonymous I'm about ready to give up.
    Thursday, October 14, 2010 6:16 PM
  • User-1314707342 posted
    Hi Jansaman I've had a similar error that has been driving me insane. Basically I installed PHP through windows live installer - still got error. Installed PHP manually through ZIP file - still got error. More or less, I've traced the error back to enabling extensions with FAST-CGI. As soon as I enable an extension in the PHP.ini file, I get the 500 error. Is this similar to what you're getting? Perhaps its a bug?
    Sunday, October 24, 2010 10:26 PM
  • User1836921533 posted
    Hello jansanman
    I am getting same error...is there any lucky...you got any solution?

     

    Wednesday, January 5, 2011 3:57 AM
  • User-1672167363 posted

    Hello, 

    "I am trying to run PHP via FastCGI on a Windows 2008 server.

    I followed this installation doc learn IIS Net"  

    and have checked

     I completed the steps correclty numerous times.

    However when I try to execute a php page i am presented with the following error:

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

    Detailed Error Information

    Module: FastCgiModule
    Notification: ExecuteRequestHandler
    Handler: PHP via FastCGI
    Error Code: 0x000000ff
    Requested URL: localhost/test.php 
    Physical Path: C:\inetpub\wwwroot\test.php
    Logon Method: Negotiate
    Logon User: Domain\user"

    These are the Steps and methods,

    The setup for running php scripts is a four part procedure.

    A) The first part is telling the web server where to find the "php.exe" which will execute the code.

    B ) The second part is telling the web server how to handle the "*.php" files which will be passed to the "php-cgi.exe".

    C) The third part is telling the web server how this is going to work which is a "Handler Mapping".

    D) The fourth part is telling the web server it will use "Fast CGI" as a safe method to execute the code.

    The steps are open the IIS Manager and find the "Panel" marked "Handler Mappings".

    While in the "Handler Mappings" select create a new mapping.

    For the new mapping select the wildcard "*.php" then for the "executtable" browse to where the "php-cgi.exe" is located

                enclose the executable name in double quotes ""php-cgi.exe"" then

                  select in the method to use select the "Fast-CGI"

                         then go to the "Restrictions" "Button" then select each "Tab"      

               Mapping ( file and the check box selected)

              Access( file check box).

              Verbs (type in GET,HEAD,POST).

    Close the "button" and the dialog it then will prompt with do you want to all this press the "yes".

    Exit the "Handler Mapping" dialog.

    While still in the IIS manager find the "Panel" titled "Fast CGI" open the "panel" and browse to where

    the "php-cgi.exe" is located. You then will have an additional dialog that has a label "Monitor Changes to file"

    select this option and browse to where the "php.ini" is located.

    After making all the changes above restart the web server.

    The steps here are just the basics to get the mapping correct.

    You should be able to execute php code at the server

    Cheers :)

    If you have more issues post your questions to this thread.

    Martin :)

     

    Wednesday, January 5, 2011 4:46 AM
  • User-409962133 posted

     I am getting the same message with IIS7 on a Windows Server 2008 machine.  But only at the very end of my processing, and only if I include any functional e-mail sending functions.  If I skip the e-mail section, everything works fine, but the moment I include the .inc - poof!  500 error.  It doesn't seem to matter which .inc I use (I've tried phpGuru's rmail most recently, also cdosys, aspemail, htmlmimemail, and others).

     I'm tearing my hair.  I've rewritten the code five ways from Sunday, but it doesn't seem to be a php error (the code is good and works on other (older) servers), but is some sort of problem using php-cgi.exe with FastCGI.

     Any ideas would be greatly appreciated.

    ~Z

    Wednesday, April 6, 2011 8:49 PM
  • User-1238736041 posted
    I am getting the very same error also. I have been trying for 3 days to get this to work. I have tried at least 3 different ways to create the Handler Mappings and nothing gets me past the 500 error. The odd thing is if I open a WindowsPowerShell window and use the PHP CGI executable directly then I see HTML output: d:\php\php-cgi.exe C:\inetpub\wwwroot\phpinfo.php I am using Windows Server 2008 R2 Standard Version 6.12 (Build 7600) Internet Information Services (Version: 7.5.7600.16385) PS D:\php> php -version PHP 5.3.6 (cli) (built: Mar 17 2011 10:48:37) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies I followed these directions: http://us3.php.net/manual/en/install.windows.iis7.php and I also read the install.txt file that came with the PHP code but still cannot get PHP to work in IIS7. I think it must be a permissions error so that is my task today to see if I can find out how to set permissions for the IIS7 users.
    Thursday, April 7, 2011 10:00 AM
  • User-1672167363 posted

    Hello,

    Well it appears you have a working php.ini and that often is the hard part.

    I suggest that you first use the IIS Net Learning guides http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/ .

    And for users / accounts use this guide http://learn.iis.net/page.aspx/140/understanding-built-in-user-and-group-accounts-in-iis-7/ .

    Common cause php-cgi.exe failures Application Pool not being correctly followed by recycle settings

    http://learn.iis.net/page.aspx/697/configure-php-process-recycling-behavior/ .

    Martin :)

     

    Thursday, April 7, 2011 10:35 AM
  • User-1238736041 posted
    I finally fixed the problem by reading this article: http://forums.iis.net/t/1176350.aspx and changing the permissions using the post from "03-11-2011, 10:18 AM". I was missing the local IIS_IUSRS permissions for my d:\php folder and my d:\data\php folders. Once I fixed that, now I finally see phpinfo.php working!
    Thursday, April 7, 2011 11:23 AM
  • User944207257 posted
    I had the same problem. It has been solved by remarking the three extensions in php.ini: php_fileinfo.dll php_shmop.dll php_xsl.dll
    Saturday, October 13, 2012 5:20 AM
  • User703229225 posted

    Yeah, Thanks HCamper, i did that and my Win7+IIS+PHP 5.3.8 is working.

    My problem was in 

    • Set extension_dir to point to the location where the PHP extensions are located. Typically, for PHP 5.2.X the value would be set as extension_dir = "./ext"
    Because in Windows: extension_dir = "ext"
    Thursday, September 12, 2013 11:59 AM