Get Your Free IT Resume Guide

IIS 7: Install FastCGI PHP on Server 2008

Topics Mentioned
Operating System(s):

One of the major advantages that the Apache web server enjoyed over IIS for years has been the native support for PHP. Most Windows Hosting you get will, if you’re lucky, install PHP for you but not support it at best.

This left some of the best open source programs out there too much of a hassle for most users. With the release of the FastCGI module you can now reliably host PHP programs on IIS.

Let’s go ahead and walk through installing the Fast CGI Module and PHP.

How to Install FastCGI on Server 2008

A few prerequisites for installing FastCGI would seem obvious but let’s go ahead and mention them anyway.

The first of course is an installation of Server 2008 (though this works on Vista if you are so inclined) and having IIS 7 installed already. You can also enable FastCGI while installing IIS, but for this demo I already have a virtual server with IIS 7 installed so let’s go with that.

If you need help installing the web server you can read my article on Installing IIS 7. Now let’s start:

1. Open Server Manager.

2. In the left pane expand Roles and click Web Server (IIS), then in the center pane scroll down and click Add Role Services.

IIS 7: Install FastCGI and PHP on Server 2008 - 1

3. Next on the Select Role Services screen select CGI, under Application Development, then click Next.

IIS 7: Install FastCGI and PHP on Server 2008 - 2

4. Confirm Installation Selections by reviewing the options you picked and then click Install.

IIS 7: Install FastCGI and PHP on Server 2008 - 3

5. You should see Installation Succeeded on the Installation Results screen; go ahead and click Close.

IIS 7: Install FastCGI and PHP on Server 2008 - 4

6. You will now see the CGI role service under the IIS panel.

IIS 7: Install FastCGI and PHP on Server 2008 - 5

Now that wasn’t too bad was it? You will notice that you installed CGI instead of FastCGI, but by selecting CGI it enables both. Now let’s move on to installing PHP!

How to Install PHP on IIS 7

When dealing with PHP there are many different versions that are in use and depending on the application you are going to be using you may need a specific version. There are also repackaged versions like those from Zend that are pre-packaged and optimized extensions that work together.

If you want to use the official release you can get it from: http://www.php.net/downloads.php

For this demo I am going to use PHP 5.2.6 Non-thread-safe installer under Windows Binaries. It is recommended to use the non-thread safe build with IIS 7 since FastCGI will ensure single threaded execution environment.

Once you download it to your server let’s get started.

1. Left click on the PHP Installer Binary.

IIS 7: Install FastCGI and PHP on Server 2008 - 6

2. You will now see the PHP Setup Wizard window, go ahead and click Next.

IIS 7: Install FastCGI and PHP on Server 2008 - 7

3. On the End-User License Agreement, go ahead and place a check in the box accepting the terms in the License Agreement and then click Next.

IIS 7: Install FastCGI and PHP on Server 2008 - 8

4. Now select a destination folder, for our example I am going to use C:\PHP5\, type or navigate to where you want to install it and click Next.

IIS 7: Install FastCGI and PHP on Server 2008 - 9

5. Now select IIS FastCGI as the web server and click Next.

IIS 7: Install FastCGI and PHP on Server 2008 - 10

6. The Choose Items to Install screen is next. I am going to stick with the default, as adding extensions that you don’t need increases your vulnerability profile.

If you have need of an additional Extension just open up the drop down and choose it, then click Next.

IIS 7: Install FastCGI and PHP on Server 2008 - 11

7. Here comes the big moment! Click Install and watch the magic happen.

IIS 7: Install FastCGI and PHP on Server 2008 - 12

8. You should see the Setup Completion screen now. Go ahead and click Finish.

IIS 7: Install FastCGI and PHP on Server 2008 - 13

9. Ok, now we will have to make a few modifications to the way PHP handles itself so we are going to modify the php.ini file.

First navigate to the place you installed PHP and open php.ini in notepad.

IIS 7: Install FastCGI and PHP on Server 2008 - 14

10. First let’s modify fastcgi.impersonate and set it to 1. Remember you are going to have to uncomment these first and then change the value, and also CTRL+F is your friend!

IIS 7: Install FastCGI and PHP on Server 2008 - 15

11. Now find cgi.fix_pathinfo and set it to 1 also, remember to uncomment by removing ;

IIS 7: Install FastCGI and PHP on Server 2008 - 16

12. Next up is cgi.force_redirect and we are going to set this to 0, and uncomment.

IIS 7: Install FastCGI and PHP on Server 2008 - 17

13. Then let’s set open_basedir to the root level of our website content directory, which I will use the default C:\inetpub

IIS 7: Install FastCGI and PHP on Server 2008 - 18

14. Now save your changes to php.ini

IIS 7: Install FastCGI and PHP on Server 2008 - 19

That’s it! Let’s go ahead and test the install, by going to a command prompt and doing the following:

1. Open a command prompt.

2. Navigate to the directory you installed PHP to.

3. Type in: PHP –info and you should see a lot of scrolling and information. This means PHP is good to go.

Below is the start of the command and output, then the second picture is the last thing that will be shown.

IIS 7: Install FastCGI and PHP on Server 2008 - 20

IIS 7: Install FastCGI and PHP on Server 2008 - 21

You have now properly installed and tested PHP on the server. Now we have to configure IIS 7 to use PHP through FastCGI.

How to Configure IIS7 to use PHP

IIS7 can be configured to handle PHP mappings at server or site levels, but for this example we are going to set the configuration at the server level. This just basically tells the server how to handle files with .php type extensions.

1. Open IIS Manager and select the server in the left pane and then click on Handler Mappings in the center pane.

IIS 7: Install FastCGI and PHP on Server 2008 - 22

2. In the right Action pane select Add Module Mapping…

IIS 7: Install FastCGI and PHP on Server 2008 - 23

3. Fill out the following information and click OK:

Request Path: *.php
Module: FastCgiModule
Executable: {path to your PHP install}\php-cgi.exe
Name: Whatever you want

IIS 7: Install FastCGI and PHP on Server 2008 - 24

4. You will get a popup asking if you want to create a FastCGI application, go ahead and click Yes.

IIS 7: Install FastCGI and PHP on Server 2008 - 25

5. You will now see your enabled handler in the list.

IIS 7: Install FastCGI and PHP on Server 2008 - 26

You have now successfully setup your IIS7 web server to handle PHP files via FastCgi. But don’t take my word for it, let’s go ahead and run a test.

1. Navigate to the default site directory at C:\inetpub\wwwroot

2. Create a file called info.php and place the following in the file:

<?php phpinfo(); ?>

3. Open your browser and point it at http://localhost/info.php and you should see a PHP information page similar to this:

IIS 7: Install FastCGI and PHP on Server 2008 - 27

This shows a successful handling of PHP files by IIS7. You have now configured your server to run PHP via FastCGI on IIS7.

My next article in this series will talk about installing some of the more popular databases and applications that can use PHP. If you have any requests feel free to leave a comment.

More Related Posts

  1. How to Install IIS 7 and Setup a Static Website in 13 Easy Steps
  2. Install Read-Only Domain Controller on Windows Server 2008
  3. Remote Administration of IIS 7: Install, Configure, Connect
  4. 10 Steps to Installing the Web Server Role in Windows Server 2008
  5. Installing FTP Publishing Service for IIS 7.0

Discussion

111 comments and trackbacks for “IIS 7: Install FastCGI PHP on Server 2008

Comments

  1. Posted by miza on September 11, 2008, 5:26 pm

    Thanks a lot i realy like it.

  2. Posted by Javier on September 16, 2008, 4:51 pm

    With this install, only the http:/localhost/*.php run, but if I want to run php in a site doesn’t work.

  3. Post Author
    Posted by David Lawlor on September 16, 2008, 6:17 pm

    Javier-

    What error are you seeing? If it runs in localhost, which is the default website, it should run in any other site on that server as long as you assigned the handler at the server level.

    Let me know the exact error and we can work from there.

    Dave

  4. Post Author
    Posted by David Lawlor on September 17, 2008, 9:43 am

    Just so anyone reading this knows, I contact Javier through email and found that the error has cleared up for him so you are good to use this method to install :)

  5. Posted by Sune on September 18, 2008, 6:17 am

    Great guide, but I seem to running in to a problem as well. I went through the guide two times and the php -info outputs fine, but when I call a PHP page through IIS it doesn’t work.

    For example the info.php file just gets rendered as if it was html (i can see the php code if i view the source in my browser) while another PHP script returns “500 – Internal server error.”. It is as if the mapping doesn’t work correctly, any ideas on what to try?

  6. Post Author
    Posted by David Lawlor on September 18, 2008, 12:31 pm

    Sune-

    Use the contact form to send your email details to Kasia through the site and I will get in touch and see what is going on.

    Make sure your handler for PHP is setup at the server or site level depending on where you need it.

    Also enable logging and look at the 500 error on the other script, there is a chance you are calling a module that isn’t installed.

    Dave

  7. Posted by Nick on September 22, 2008, 1:08 pm

    Dave,
    Great tutorial, just what I needed!

    I did all of the steps, and they appear to go pretty well.
    php.info does not render html for some reason. Any hint will be greatful.

  8. Post Author
    Posted by David Lawlor on September 22, 2008, 3:28 pm

    Nick-

    Are you getting an error for PHP.ini or is it just coming up as plain text? As above use the contact form to send in your details and I will get back to you to see what is going on.

    Dave

  9. Posted by João on October 1, 2008, 5:02 am

    Hi

    I’ve followed the steps, info.php works fine but other script to users perform login no, it returns the 500 internal server error, as reported by other users. Any of those who got the error or the author of the article can explain me how they solved the problem?

    Site is still not on-line until I solve that issue.

  10. Post Author
    Posted by David Lawlor on October 1, 2008, 10:21 am

    Joao-

    It really depends on the script. As was mentioned in the article, this is just a base install, different scripts require different extensions. Are all the necessary PHP extensions loaded for the script? You say you got a 500 error, is logging enabled so you can get an more clear error message?

    Use the contact form to send your information to Kasia and I will try and help you through this. Please send the following at least:
    Send script name
    Enable logging and get a more precise error of what the 500 is triggering on
    A list of all enabled PHP extensions.

    Thanks,
    Dave

  11. Posted by Elena on October 2, 2008, 5:06 am

    Hi Dave. Thank you for your article.

    I did everything you said in the article, but when I tried to open my info.php in the browser it doesn’t show me the page you mentioned above. It just shows me the text: ‹?php phpinfo(); ?›.

    What could caused that problem?

    Thanks in advance.

  12. Posted by Gary Davis on October 11, 2008, 1:14 pm

    If I go to http://webguild.dyndns.org/info.php, I get the HTTP 404 error. If I go to http://localhost/info.php from the server itself, I get

    —–

    HTTP Error 404.3 – Not Found
    The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

    Most likely causes:
    * It is possible that a handler mapping is missing. By default, the static file handler processes all content.
    * The feature you are trying to use may not be installed.
    * The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
    * If ASP.NET is not installed.

    Things you can try:
    * In system.webServer/handlers:
    o Ensure that the expected handler for the current page is mapped.
    o Pay extra attention to preconditions (for example, runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.
    o Pay extra attention to typographical errors in the expected handler line.

    * Please verify that the feature you are trying to use is installed.
    * Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.
    o To set a MIME type, use the following syntax: %SystemRoot%\windows\system32\inetsrv\appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']
    o The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.
    o For example, to add a MIME map for a file which has the extension “.xyz”: appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']

    Warning: Ensure that this MIME mapping is needed for your Web server before adding it to the list. Configuration files such as .CONFIG or dynamic scripting pages such as .ASP or .ASPX, should not be downloaded directly and should always be processed through a handler. Other files such as database files or those used to store configuration, like .XML or .MDF, are sometimes used to store configuration information. Determine if clients can download these file types before enabling them.

    * Install ASP.NET.
    * Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

    —-

    I did get the data out from the php -info command line OK.

    I verified the IIS 7 steps to add the handler. One thing that happened not mentioned in your detailed steps was that attempting to add E:\Program Files\PHP\php-cgi.exe resulted in a popup that said quotes are needed if there are spaces in the command (there aren’t but maybe it was complaining about the hyphen. Enclosing in quotes solved that request.

    The handler is shown as enabled for *.php.

    Any ideas on this?

    Windows Server 2008 x86

    Thanks,
    Gary Davis

  13. Posted by Gary Davis on October 11, 2008, 2:40 pm

    OK, I solved the problem of the 404.3.

    First, I uninstalled PHP which was installed at E:\Program Files\PHP since I thought it may be a permissions problem. I Installed it at E:\PHP. This did not help, even when adding NETWORK SERVICE to the securities list.

    When the Handler Mapping was added this time, it did not complain about the quotes.

    I then re-added the Handler Mappings at the web site level (Default Web Site) since it did not show up there even though it was mapped at the server level.

    Now, the Info.php ran!

    Thanks,
    Gary Davis

  14. Post Author
    Posted by David Lawlor on October 13, 2008, 10:01 am

    Gary-

    Thanks for the follow-up on your issue. The reason the handler wanted quotes is because of the space in “Program Files” since that is part of the path for your command line and while the Windows GUI handles the space ok, the command line would need the quotes.

    I am surprised that adding the mapping at the server level did not get inherited by the default website. I will run a test on my server to see if I can replicate that issue.

    Thanks again for your follow-up.

    Dave

  15. Posted by LIX on October 15, 2008, 6:54 am

    Elena and everybody who gets plain php code instead of correct result – symbols ” in this guide are replaced with some Unicode symbols which look a lot like them. Therefore php code won’t work, if you are trying to run code copy-pasted from this article. Some little nasty mistake.

  16. Posted by LIX on October 15, 2008, 6:57 am

    It seems that engine of forum eats this symbols.
    I meant greater-than sign > and less-than sign <

  17. Posted by Colin on October 20, 2008, 11:56 am

    I followed it step by step and it’s didn’t work for me in windows server 2008
    if I go to the http://localhost/info.php I get an HTTP 404 Not Found error…

  18. Post Author
    Posted by David Lawlor on October 20, 2008, 1:36 pm

    Colin-

    A 404 error should only be evident if your info.php file was not in the right location. Check the root path for your default website which should be by default:
    %SystemDrive%\inetpub\wwwroot and make sure that the info.php file is found under that directory. If PHP was an issue you would have either seen only the text in the info.php file or gotten a 500 error.

    If this is a server I could access send your information through the contact form on this site and I will contact you to see if I can give you a hand.

    Dave

  19. Posted by Wesley on October 21, 2008, 8:55 pm

    I too had the same issue, where the first php file I created (per the tutorial) did not render in my website directory. After hours of troubleshooting, I simply created another PHP file and that one runs fine, with the sample script copied and pasted. And still the original PHP file I created does not render. I verified the extention, made sure it was not a text file… it just won’t run. If I run it on the localhost, I get a 500 error by the way with that file, but not the new one I created. They are both in the same folder, appear to have the same permissions. Wierd.. but anyway.. this sounds like the same problem everyone else is having.

  20. Posted by Wesley on October 21, 2008, 8:57 pm

    So maybe LIX is right.. although, I copied it straight into a text file from this site.. and I copied it from that text file to my new php file (which did work).. so I still don’t get it completely.. but it kinda makes sense.

  21. Posted by Cal on October 22, 2008, 5:01 pm

    I don’t know too much about php, MySQL, or server 2008, but I followed instructions from this site exactly. IIS7 and info.php worked fine. MySQL Command Line Client works fine. location of folders (C:\PHP5; C:\Program Files\MySQL) I am comfortable with SQL so I don’t need a GUI for it. I am trying to get php to connect to mySQL using the below code. I assume user and password are a user on the server. Is there some setting I’m missing or some file that needs to be moved? Below is the code:

    IExplorer displays:
    PHP Fatal error: Call to undefined function mysql_connect() in C:\inetpub\wwwroot\mySQL.php on line 5

    Thanks ahead, any hint would be appreciated!

  22. Posted by Cal on October 22, 2008, 5:03 pm

    lol, sorry code disappered I took out the this time:

    $user=”staff”;
    $password=”notrealpassword”;
    $database=”mysqldb”;
    mysql_connect(localhost,$user,$password);
    @mysql_select_db($database) or die( “Unable to select database”);
    $query=”CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))”;
    mysql_query($query);
    mysql_close();

  23. Post Author
    Posted by David Lawlor on October 22, 2008, 5:09 pm

    Cal-

    Is the MySQL extension configured for PHP? Make sure the following line is uncommented out in your php.ini

    extension=php_mysql.dll

    Let me know if that works,
    Dave

  24. Posted by Cal on October 22, 2008, 7:39 pm

    It didn’t make a difference. I tried “extension=php_mysql.dll” and “extension=mysql.dll” seperately followed with the php -info in the “PHP5″ directory. I’m wondering if maybe the user should be blank(“”), Administrator, or root? Thanks for the fast response! I’m wondering if I should redo the whole server following different instructions.

  25. Posted by Cal on October 22, 2008, 9:26 pm

    I found the “php.ini” file in the PHP5 folder and did not find extension=php_mysql.dll so I typed it in. Is there another “php.ini” file? If so where is it?

  26. Post Author
    Posted by David Lawlor on October 23, 2008, 11:10 am

    No there should only be one php.ini, it was the same one you modified in the article above.

    I dont think it is a permission issue because the error is a PHP one and it is because the Mysql handler isnt functioning properly. You may need to restart the server to get the extension to take.

    If you want to make sure rerun the installation above for PHP and in step 6 go into the dropdown for extensions and choose MySQL from the extensions.

    I emailed you directly, feel free to contact me directly and I will post a summary on here when we figure it out.

    Dave

  27. Posted by Matthew on November 12, 2008, 3:20 pm

    Great guide…

    one question though, using the .exe php installers, how can i add mysqli support, it seems it is listed under the php.ini file, but i have pages that wont work, i had them working under ISAPI module and by un-comment and copying dlls around.. but the installer has no dll to move around, should mysql / mysqli just work..

  28. Posted by Matthew on November 12, 2008, 3:23 pm

    ignore that last one, silly me didnt choose the mysql items during the installer :)

  29. Posted by tween on November 19, 2008, 8:59 pm

    Hi-
    16 hours and no luck. 500 internal server error, 403 errors. Uninstalled, reinstalled php, mysql. PHP Info won’t run. Ran for most of the day until I reinstalled php 5.2.
    .html files work, php files don’t. trying to install wordpress on server 2008. server has sharepoint on it. can’t take it off as I host sharepoint.

    500 – Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.

    IIS handlers configured properly. default page set to index.php.

    Any suggestions would be greatly appreciated.
    P.

  30. Posted by Calvin on November 21, 2008, 9:09 am

    Thanks for a Great guide.
    Unfortunaltely PHP info runs on the default site, The Handler Mapping are there and carry over to the other sites but it will not run outside of the default on another site, I keep getting 500 – Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.

    I know other people have had this issue 500 issue, any hints or help would be greatly appreciated.

  31. Post Author
    Posted by David Lawlor on November 21, 2008, 9:34 am

    Calvin -

    Check the logs for the exact 500 error it should be more specific. Though what catches most people is that the new site directory is outside the directory specified in step 13 which is the open_basedir statement. All sites that you want to work with PHP have to fall under this top level directory. If you are using a directory outside what you placed in that path they will not work.

    Let me know if that helps, or if you can find a more specific error.

    Dave

  32. Posted by Matthew on December 29, 2008, 11:02 am

    When I try to access http://192.168.0.88/info.php it works. When I try to access http://localhost/info.php it does not work. When it does not work I get a error 404.

    When I access http://192.168.0.88/info.php remotely it works. However, when i just do http://192.168.0.88/ no site loades up I get an error 500.

    Any ideas??

  33. Posted by Matthew on December 29, 2008, 12:10 pm

    my logfile:

    #Date: 2008-12-29 17:57:14
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
    2008-12-29 17:57:14 192.168.0.88 GET / – 80 – 192.168.0.25 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 234
    2008-12-29 17:59:29 192.168.0.88 GET / – 80 – 192.168.0.25 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 187
    2008-12-29 18:00:48 192.168.0.88 GET / – 80 – 192.168.0.16 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30;+.NET+CLR+3.0.04506.648) 500 0 0 171

  34. Post Author
    Posted by David Lawlor on December 29, 2008, 4:49 pm

    Matthew -

    Ok let me ask a few more specifics to make sure I know exactly where you are at.

    Ok so it works if you go directly to the info.php with a IP so we know it is working.

    Since it doesnt work with localhost can you tell me how this server is setup? First did you create a new site for the PHP or are you using the default one? Does the server have more than one IP assigned to it?

    For the remote answer it is more than likely your default document setting for the site. Make sure you have a default document there for the site. Or set your default document to info.php if you dont have any other documents setup right now.

    Let me know how much that clears up and we can go from there.

    Dave

  35. Posted by Matthew on December 30, 2008, 9:28 am

    The server is a 2008 virtual server sitting on a 2008 server. It hosts AD/DNS/IIS. It is the primary AD/DNS but there is a secondary on the network as well and it’s all a member of a domain. As far as the virtual server goes, no it only knows there is one IP.

    I have my default document set to index.php. I even renamed index.php to info.php and info.php to index.php and accessed http://192.168.0.88 and the phpinfo page showed up just fine.

    I believe now that because of what i just mentioned there is something in my index.php that is holding me up. This site has been working for a few years and was working just fine on a IIS 6 (actually still is i’m just deploying a backup on iis 7). There is a mysql connection and the mysql is installed with the data populated and i can connect to it and see all the data just fine w/ sqlyog (sql browser).

    I looked up error 500 0 0 171 (i believe) and it pointed to something about SMTP connection. My site does pass the password to our internal email but that resides on a remote linux box. Also, my connect script for mysql calls for locahost (remember i can’t connect to localhost) so i changed that to the IP instead but no luck.

  36. Posted by Matthew on December 30, 2008, 10:01 am

    oh also, yes, i created a new site and am not using the default one nor am i using the default pool.

    I tried to use them though and get the same results. they are both pointing to the same directory to use. (i stopped the default site/pool while trying to run the new site/pool)

  37. Posted by Matthew on January 1, 2009, 8:11 pm

    I’ve stumped him!! :)

  38. Posted by Matthew on January 1, 2009, 9:09 pm

    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
    2009-01-02 03:06:17 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 218
    2009-01-02 03:06:19 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 234
    2009-01-02 03:06:19 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 218
    2009-01-02 03:06:19 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 218
    2009-01-02 03:06:19 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 250
    2009-01-02 03:06:20 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 234
    2009-01-02 03:06:20 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 218
    2009-01-02 03:06:20 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 218
    2009-01-02 03:06:20 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 234
    2009-01-02 03:06:20 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 250
    2009-01-02 03:06:22 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 218
    2009-01-02 03:06:22 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 234

  39. Posted by Matthew on January 1, 2009, 10:42 pm

    ok…uninstalled IIS7. Reinstalled IIS7 and PHP 5.2 as per the following step by step guide:

    http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/

    (this looks identical to yours and i followed yours originally)

    I still get the following errors:

    2009-01-02 04:36:16 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 234
    2009-01-02 04:36:16 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 187
    2009-01-02 04:36:16 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 203
    2009-01-02 04:36:16 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 203
    2009-01-02 04:36:16 192.168.0.88 GET / – 80 – 68.229.237.116 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.5)+Gecko/2008120122+Firefox/3.0.5 500 0 0 187

    if any advice please email hardwerk@gmail.com I really appreciate any info.

  40. Posted by Matthew on January 2, 2009, 10:52 am

    My site runs just fine on IIS 6. Is that because of ISAPI? Is there any reason my site would require ISAPI vs FastCGI?

  41. Posted by dirt on January 28, 2009, 2:28 pm

    500 Error SOLUTION:

    Add “IIS_WPG” group with +RXL permissions to C:\PHP5 directory

  42. Posted by Mike Taylor on February 5, 2009, 12:22 pm

    Hello.

    Thank you for well made document. I was nicely done.

    I have Server 2008 and downloaded PHP 5.2.8. I followed your steps precisely, but I received a 404 error. Anyhow, I found the problem. My server settings, by default, was set to “hide extensions for known file types.” I unselected that option, removed the trailing .txt from the info.php file that was created, and there it worked.

    I typically show file extensions, however; this being a fresh install of Server 2008, I didn’t get around doing that just yet. So naturally that error threw me into a loop.

    After reading some of the responses, I just thought I mention that as I think some people may have ran into a similiar sistuation.

    Mike

  43. Posted by Anthony on March 16, 2009, 6:48 pm

    Thanks for the help work 1st time was going crazy.

  44. Posted by Shuoming on March 24, 2009, 10:57 am

    Thanks so much for all the information you put up there!

    I installed php 5.3 nts x64 and Mysql 5 x64 on Windows 2008×64 (hardware and operatesysem)with ii7 configed fastcgi. They run individually fine. php -info tested good. But when installing moodle 1.9.4 I got error like this: HTTP error 500.0 – internal Server Error The page cannot be displayed because an internal server error has occurred. Detail Error Information:

    Module FasModule: FastCgiModule
    Notification: ExecuteRequestHandler
    Handler: PHP via FastCGI
    Error Code: 0×00000000
    Requested URL: http://localhost:80/moodle/index.php
    Physical Path :C:\inetpub\wwwroot\moodle\index.php
    Logon Method :Anonymous
    Logon User: Anonymous

    Could you please take a look?

  45. Posted by Amster on March 31, 2009, 5:27 pm

    Excellent tutorial mate. Worked for me on Vista+II7

    Thank for taking the time out to share this information – you’re a good guy.

    Now all I need to do is set up MySql on Vista! (need another walk through like this lol!)

    Cheers

  46. Posted by Steve on April 4, 2009, 9:06 pm

    So I installed PHP 5.2.6 on Server 2008 Web/IIS 7. I configured FastCGI as above.

    My phpinfo.php works fine. I setup a PHP application (amiroCMS) all written in PHP and I was able to configure it, set it completely up, config a mysql DB etc. But when I get to the login page after the config and actually login I get an error:

    HTTP Error 500.0 – Internal Server Error
    There is a problem with the resource you are looking for, so it cannot be displayed

    Module FastCgiModule
    Notification ExecuteRequestHandler
    Handler PHP_via_FastCGI
    Error Code 0x8007000d
    Requested URL http://auctionmasters.com:80/amiro/_admin/index.php
    Physical Path \www\AuctionMasters\amiro\_admin\index.php
    Logon Method Anonymous
    Logon User Anonymous

    Nothing I do will make this error go away. I can render other php pages and phpinfo works fine, but for some reason it fails upon the actual login.

    I also installed phpMyadmin for Mysql administration, and that ever works fine – I can create, modify delete db’s etc.
    Ironically, MS has no info on the 0x8007000d error and no info on FastCGI errors.
    Enabling PHP logging does nothing either.

    Any input on the error or how to trace down what the cause it?

  47. Posted by imperia on April 8, 2009, 9:36 am

    I’ve managed to fix 500.0 Internal server errors I was getting with default PHP Version 5.2.9-2 installation. Here is what I did. First I followed the guide above. Then I ran Command Prompt (with administrator rights). Then I ran php-cgi. I got errors like this:

    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_mssql.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pdo_mssql.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pdo_oci.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pdo_oci8.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pdo_pgsql.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pdo_sqlite_external.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pgsql.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_pspell.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_sybase_ct.dll’ – The specified module could not be found.
    in Unknown on line 0

    Run Notepad (with administrator rights) and open php.ini from C:\Program Files\PHP
    Go to the end of the file. Stop php from loading the modules that you had error with. Remove each 2 lines with problem modules. Example

    [PHP_MSSQL]
    extension=php_mssql.dll

    ^^^^ remove both or comment with ;
    Do this for each module that you got error with.

    Save the ini file and run again php-cgi to see if you have fixed the errors.

    Try running again your phpinfo.php script in your browser to see if its working.

    I guess the right way to install php is to enable modules that you really need, not all of them. Maybe the errors are caused by bad “Module Settings” in php.ini file, because the actual .dll files are present in the \ext folder. So the error “The specified module could not be found.” is misleading.

    I hope this helps. If you are still unable to make it work, I may post my php.ini settings here.
    Good luck.

  48. Posted by Daniel Grogan on April 14, 2009, 7:16 am

    Absolutely excellent, very easy to follow

  49. Posted by mmkeebler on April 16, 2009, 9:12 am

    This method worked great for me. Thanks for the great tutorial.

  50. Posted by Joseph Hillhouse on June 2, 2009, 5:47 pm

    THANK YOU!!!!!! so much. I have tried everything and spend at least 12 hours on it installing from the zip package and the installer using fastcgi, cgi, and isapi script but it would always go wrong. Finally it works and I can connect to my database. I was almost ready to give up.

  51. Posted by Max on June 4, 2009, 5:39 am

    Thank you for the super clear explanation! Worked on the first try, thanks!

  52. Posted by Mbalthrop on June 13, 2009, 12:45 pm

    Thank you, this was exactly what i was looking for.

  53. Posted by Lindsay on June 18, 2009, 6:50 pm

    Dave,
    I read through this, and a whole bunch of other google results for the 500 internal server error.

    I am still getting it.
    specifically, whenever php tries to do anything with mysql
    i can run phpinfo() in a script from a browser just fine.
    if the only function in my php script is mysql_connect(), with proper credentials for mysql, i get the 500 error.

    My problem here is that i am trying to help the windows server administrator figure this out. I am a *nix admin, not windows.

    They are running windows server 2008. i think their environment _might_ be virtualized, but i am not sure.

    Any ideas?

  54. Posted by Henrik Hansen on June 19, 2009, 4:53 pm

    Hi Dave, at first i must say… rly rly nice work you do for help us out “out here in the world” :)

    I have follow all your guides to get a windows server 2008 std, to work as IIS 7 whit PHP and mySQL whit phpmyadmin.

    As faar all looking good – i mean, my phpinfo.php works fine – mySQL db works i can manage it by GUI tools, and phpmyadmin.

    and it`s abit strange how to try explain the problems i do have – but i try:

    exampel site:
    1.) i do have the real site ( old server ) here: http://www.tinglev-bogtrykkeri.dk
    - all works fine and includes and connections to mySQL works.

    2.) i do have the same site ( on new server ) here: http://tinglev-bogtrykkeri.dk
    - its look like the includes work, but don`t get the “my SQL data” on the site.
    - when i try view source code, i can see the indcludes on the site, whit not are normaly.

    On thats it`s seem like “php not work” – but when i try make a php info file on same “web site” http://tinglev-bogtrykkeri.dk/phpinfo.php – it`s show like it should work?

    Do you or some have anny idea what`s wrong, and how to fix it?
    - rly almost about to get crazy about it! :)

    Thanks alot, Henrik

  55. Posted by Johnny Burnette on June 28, 2009, 10:23 pm

    Nice job! You make it look so easy.

  56. Posted by Li Hoang on July 4, 2009, 3:16 pm

    Thanks so much for this info. I’ve been stressing my PHP set-up because I kept receiving this error: “Unable to load dynamic library ‘C:\Program Files (x86)\PHP\ext\php_mssql.dll’”

    But with your configurations, it’s finally gone. My PHP instructor couldn’t even help me.

    Thanks so much!

  57. Posted by Bharathi on July 13, 2009, 4:16 am

    nice article dude.will helps me a lot.

  58. Posted by Justin on July 14, 2009, 3:47 pm

    First off, very nice guide.

    However, I also have a failed attempt.

    I did this on a W2K8 x64 machine. I installed PHP 5.3 into C:\PHP5.

    One additional comment I’d like to add is that I found no need to “Add Module Mapping”. It was added for me. With an addional attribute. File Type is listed as File or Folder instead of unspecified.

    When I try to run your sample code I get 500 as well. The log file tells me nothing other then 500 0 0.

    Installing PHP on IIS6 requires additional security permissions be set. Yet here in your tut I see no permissions?

    Are there any missing permissions?

    I then removed PHP 5.3 and reinstalled 5.2.10 and this time installed it into the PROGRAM FILES(x86) folder and have the same exact issue. Error 500 when running PHP PHPINFO

  59. Posted by Justin on July 14, 2009, 4:25 pm

    I feel like a heel. I screwed up the basedir option on my second go around. When I fixed it, it started to work.

    So, one of two things fixed my problem on a x64 machine. Either:

    1. Not using 5.3 and going back to 5.2.10 worked.
    or
    2. Installing PHP into the x86 program files folder worked.

    Or both.

    Now I have a new problem. I can only run PHP from a single folder. If I select C:\ as the basedir, no folder works.

    Why do I have to select one specific folder? I run lots of website from this server that require PHP.

    C:\web
    C:\test
    C:\xxxxx

    And so forth. I need to put them ALL into a single folder and run them from that?

    C:\PHP Sites\web
    C:\PHP Sites\test
    C:\PHP Sites\xxxxxx

    ???

  60. Posted by Duy on July 15, 2009, 2:34 pm

    please help me. i followed every single step that was posted in here and i haven’t been able to make my site running. i installed iis7, php but everytime i go to http://localhost, it works fine. but if i go to http://localhost/phpinfo.php, it says http404 not found. can you help me please. please email me if you want phone number to contact me. thank you.

  61. Train Signal Team Member
    Posted by Kasia Grabowska on July 15, 2009, 4:01 pm

    Hi Duy,

    It’s difficult to say what could be causing this, but here’s what you can do. Start by taking a closer look at what your error message is saying.

    Is it a 404.0 message? or is there another number after the dot that’s not a 0? You should also be seeing some suggested “most likely causes” and “what you can try.”

    Here is an article that will help you find out more information about IIS errors and how to troubleshoot them: http://mvolo.com/blogs/serverside/archive/2007/07/26/Troubleshoot-IIS7-errors-like-a-pro.aspx

    If you’re still having problems, send us more info and we’ll try to help you out.

  62. Posted by Duy on July 15, 2009, 6:42 pm

    no i solved the problem. i am the stupidest person ever. lol
    my info.php got a .txt at the end. lol unbeliveable took me all day for this thing. lol thank you for your help.

  63. Posted by Dan Sexton on July 21, 2009, 10:42 am

    I too was getting the 500 error with PHP 5.3. I went to the command line and redirected the php-cgi to a file like this:

    php-cgi E:\websites\info.php >test.htm

    The resulting test.htm opened up and displayed all of the information just fine, so it wasn’t the creation of the file that wasn’t working. However when I executed the command I did get this text on my screen:

    “PHP Warning: phpinfo(): It is not safe to rely on the system’s timezone setting
    s. You are *required* to use the date.timezone setting or the date_default_timez
    one_set() function. In case you used any of those methods and you are still gett
    ing this warning, you most likely misspelled the timezone identifier. We selecte
    d ‘America/Chicago’ for ‘-5.0/DST’ instead”

    I went into my php.ini file and set date.timezone = America/Central and now everything is working.

    Perhaps this is a new requirement for 5.3? Odd that they did not create a default…

    Hope this helps, thanks for a great easy to follow guide.

  64. Posted by Dorre Breuers on August 6, 2009, 8:34 am

    Be aware that if you create a file in windows server 2008 the extensions is hidden so:

    info.php would be info.php.txt and that can create your error.

    Rename it in dos by: rename info.php.txt info.php

  65. Posted by Adam Lavery on August 21, 2009, 8:42 am

    Mr Sexton, you’re a star!

    Been scratching around for hours trying to figure out why something so simple should cause such a headache. Quite why PHP can’t rely on the system’s timezone or if this is a pre-requisite to running PHP, they couldn’t have included the question during the installation is beyond me!

    It’s a shame this is at the bottom of this post – I’m sure many will have given up by the time they get here. Perhaps the author could update his post to include this essential information for the latest PHP release?

    To whoever is responsible for PHP – don’t be so stupid and fix this!!

  66. Posted by Brady Wilson on August 28, 2009, 5:05 pm

    Most of these posts are old but I though I would add my two cents…

    I was getting the 404.3 message as well – couldn’t figure it out because it really looked like it was setup correctly.

    It appears that IIS does not like spaces in the Handler name – so an entry for “PHP via FastCGI” will give the error whereas “PHP_via_FastCGI” will work.

    Fixed my issue anyway.

    -b

  67. Posted by Andy Reichenbach on September 8, 2009, 5:29 am

    Having issues installing PHP on Windows Server 2008 64-bit system. Downloaded the VC9 x64 Non Thread Safe zip package from: http://windows.php.net/qa/ and can’t remember where I found the .msi version (php-5.3-win32-VC9-x64-latest.msi) but I ended up getting the error message: ‘The installer has encountered an unexpected error installing the package. This may indicate a problem with this package. The error code is 2356.’

    I unpackaged the zip to the C:\PHP5 directory a week or so ago and got a successful handling return by inputing http://localhost/info.php into a browser, but then there were other issues I can’t quite remember. Am starting the process over and would like to get some guidance if the zip package is the way to go, if there is a different installer I should download or if I need to go the SVN route, or… Please advise. Thanks

  68. Posted by VooDoo on September 9, 2009, 9:37 am

    yes, DAN Sexton is a BIG STAR!!
    Thanks Dan for posting you tip here!!
    Cya
    VooDoo

  69. Posted by Dez on September 14, 2009, 2:59 pm

    I am having serious problems with my php or something. I have uninstalled IIS…PHP, MYSQL several times and i am still getting the same results. Basically my info file is showing great with no problems. I am trying toinstall a software script and when i go to the install.php on server i get:
    PHP Notice: Use of undefined constant d79260 – assumed ‘d79260′ in C:\inetpub\wwwroot\videogirls\_setup\install.php(5) : eval()’d code(2) : eval()’d code on line 1 PHP Notice: Undefined variable: ntmfcloaded in C:\inetpub\wwwroot\videogirls\_setup\install.php(5) : eval()’d code(2) : eval()’d code on line 1 PHP Notice: Use of undefined constant d79260 – assumed ‘d79260′ in C:\inetpub\wwwroot\videogirls\_setup\install.php(5) : eval()’d code(2) : eval()’d code on line 1 PHP Notice: Use of undefined constant d87260 – assumed ‘d87260′ in C:\inetpub\wwwroot\videogirls\_setup\install.php(5) : eval()’d code(2) : eval()’d code on line 1 PHP Notice: Undefined index: d87260 in C:\inetpub\wwwroot\videogirls\_setup\install.php(5) : eval()’d code(2) : eval()’d code on line 1 PHP Notice: Use of undefined constant d87260 – assumed ‘d87260′ in C:\inetpub\wwwroot\videogirls\_setup\install.php(5) : eval()’d code(2) : eval()’d code on line 1 PHP Notice: Use of undefined constant d98260 – assumed ‘d98260′ in

    That is just some of the code….http://localhost shows find and phpmyadmin shows with no issues….its just this install.php that is giving problems

  70. Posted by Murat Bilga on September 25, 2009, 12:08 pm

    Hi Dave. Thank you for your article.

  71. Posted by Joo on October 7, 2009, 2:19 pm

    Hi I followed your instructure and I am able to display
    info.php, but I am getting this error message when I submit a form to send_form_email.php. Please help!

    Thanks,

    HTTP Error 500.0 – Internal Server Error
    The page cannot be displayed because an internal server error has occurred.

    Module FastCgiModule
    Notification ExecuteRequestHandler
    Handler FastCGI PHP
    Error Code 0×00000000
    Requested URL http://172.16.82.100:80/send_form_email.php
    Physical Path C:\inetpub\CDCISite\send_form_email.php
    Logon Method Anonymous
    Logon User Anonymous

    IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
    IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
    IIS was not able to process configuration for the Web site or application.
    The authenticated user does not have permission to use this DLL.
    The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

  72. Posted by HcUser on October 13, 2009, 12:19 pm

    To any who get the 500 error-

    This 500 could be caused by a PHP error message generated by the application. Your best bets are to turn off fast cgi logging, and to set up a php error log. The following entries in your php.ini flie should do the trick:

    fastcgi.logging = 0
    log_errors=on
    error_reporting = E_ALL
    error_log=”C:\Windows\Temp\php-errors.log”

    The important things here are to make sure that these are the only declarations of those settings that aren’t commented out in the php.ini flie. Also, that “C:\Windows\Temp” is where your system TEMP directory is.

    You should restart IIS, and then re-run your application. If it is a PHP error that is causing the 500, you should now be able to see the PHP error in the php-errors.log file. If it was a PHP warning or notice, or other non-error message, it should now be displayed on the screen, as well as logged in php-errors.log

    Now we can party like a rock star-

  73. Posted by Lynn Breaux on October 16, 2009, 9:53 am

    I had the problem with localhost/info.php and found that my default website was not going to wwwroot. I put it in http://www.lynnbreaux.com and it works fine.

  74. Posted by fm3000 on October 28, 2009, 5:18 pm

    Hey man! thx, great tutorial, I got my 500 fixed after reading the timezone hint above!

    cheers for that.

  75. Posted by John O on October 29, 2009, 2:57 pm

    I am building a new webserver using server 2008 64bit, installed the latest version of PHP (5.3.0), everything goes well until I try the localhost/info.php, I get a HTTP 500 internal Server Error, Have read through some of the above comments, but have not figured it out yet.

  76. Posted by John O on October 30, 2009, 8:16 am

    It started working this morning, all is good!

  77. Posted by Yurii on December 3, 2009, 8:18 am

    Hello!

    meybe you can explain, how to render php when used

    I have success when render , but fail when use syntax above.

    regards

  78. Posted by Yurii on December 3, 2009, 8:20 am

    fail when [?= SOMEthing ?]

    but o.k. when [?php ?]

  79. Posted by Todd on December 22, 2009, 7:01 pm

    I am new to most of this. I have read through all these post and all seems to be working but this.

    In what format do I put:
    in the info.php file? Not sure if I use notepad or what.
    Thank you for any help

  80. Posted by Simon Price on December 23, 2009, 3:07 pm

    I have set this up and get a 404 page not found error and cant figure out why…. any ideas?

  81. Posted by Eric Tanefo on December 24, 2009, 8:11 pm

    To Dave Lawlor,

    Can you develop a package that will automate this installation process.
    I am interested in running some PHP web sites using MySQL on a server running SBS 2008.
    Thsi wil be extremely helpful since I do not want to spend my time doing this and troubleshooting the problems.

    Do you offer technical services for installation of the Apache HTTP Server as well as MySQL and PHP. I am thinking about a scenario where both IIS ad Apache could co-exist.

    Thanks,

  82. Posted by Grahame on January 27, 2010, 9:32 pm

    Dave,

    Great post – thank you. I’m hoping you – or another reader – can help with a 404 error, however.

    Have installed PSP 5.3.1 (msi) on SBS 2008R2. Modified php.ini & running “PHP -info” from command line at C:\PHP works fine.

    When I open http://localhost.inffo.php I get 404 Not Found error. Have checked IIS handler mapping etc. & all seems ok.

    Interestingly, if I open http://localhost I get our Sharepoint ‘Team Site’, instead of the IIS page. I’m not sure if this is normal & possibly related to the 404 error?

    Regards,
    Grahame

  83. Posted by Raymond Besiga on February 16, 2010, 8:37 am

    You’re a life saver.Thank you so much!! I have been trying to make this work for quite some time.

  84. Posted by Ian on March 16, 2010, 6:30 pm

    Thank you for a great tutorial. I’ve been trying to make this work on my own, with little success . At last I can host my own site.

  85. Posted by flavio on March 24, 2010, 4:48 am

    Hello, i’m having trouble with php_mssql.dll i mean i’ve:
    - installed and setup PHP 5.2.13 as fastcgi
    - uncommented the extension for php_mssql.dll
    - the ntwdblib.dll is in c:\php (ACL for c:\php is IUSR – IIS_XXX – NETWORK SERVICE full control)
    - environment include -> path=c:\php\ and and PHPRC=c:\php\
    - php_mssql.dll is in c:\ext (in php.ini the extension folder is c:\ext)

    But anytime i get this error:
    [24-Mar-2010 11:32:04] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\php\ext\php_mssql.dll’ – The specified module could not be found.
    in Unknown on line 0

    Can anyone help me???

    Thanks
    Flavio

  86. Posted by sebastian yuke on March 25, 2010, 8:02 pm

    @flavio:

    Do you install MS SQL Server extension too?
    because php_mssql.dl is extension for Microsoft SQL Server.

  87. Posted by Jamie on April 20, 2010, 11:43 pm

    So we installed php and MySQL for a WordPress site that is up and running fine. Only we didn’t install CGI/FastCGI on IIS7 which is making the pretty permalinks problematic.

    Does anyone know if it is safe to install CGI/FastCGI and adjust the handler mappings and php.ini file after the fact, or will we need to uninstall PHP and install it back again afterwards?

  88. Posted by James on April 29, 2010, 6:05 pm

    That documentation really helped a tremendous amount. Thanks!

  89. Posted by Simon on May 18, 2010, 11:45 pm

    I haven’t had time to read all the comments above, but after two days of countless unsuccessful (and unbelievably annoying) attempts to get this going I noticed that the PHP installer had already created the module mapping for me *on the server* node in the tree on the left in the IIS manager. On another article somewhere else though I read about also creating a module mapping for PHP (as described above) on the default web site node (which the PHP installer hadn’t done for me).

    Once I made the mapping above on the default web site *instead* of the server in the IIS manager I was able to get the PHP info page to work. Hope it helps.

  90. Posted by sabri on July 28, 2010, 9:06 am

    @sebastian yuke

    We met the same problem with flavio. I tried what flavio wrote above but still having

    the problem. Furthermore i installed sql server 2005 express and sql server 2008

    standart however again i got no solutions.

    Our operating system is ‘server 2008 r2′. We use last version of PHP(5.2.14).

    What do you recommend us?

    Thanks,

  91. Posted by sabri on July 29, 2010, 5:17 am

    I have fixed the problem int this way:
    Firstly at the directory where php is installed and enter
    php.exe -v to the command line.
    If it gives dll does not exists error, you should provide these dll s.
    Especially, for mssql, it gives MSVCR71.DLL error. and for curl, ZLIB.DLL error.
    When i put this dll from Zend Server to the php directory, the problem is soved.
    Thank you for your interest.

  92. Posted by Tim H on August 14, 2010, 4:53 pm

    You rock! This worked like a charm for me. Installed PHP 5.3.3 VC9 on Windows Server 2008 Standard SP2

    Thanks!

  93. Posted by Jacob on September 4, 2010, 6:04 am

    I would just like to say thankyou for this very useful article!

    I am learning about IIS and this is great!

    Thanks again!

  94. Posted by dicky on September 6, 2010, 4:57 am

    Thanks a lot,by the way, the server 2008 is 64bit or 32bit ?

  95. Posted by Dan on October 28, 2010, 11:17 pm

    HcUser, I made the settings in my PHP.INI file to the ones you specified, and I might add, disabled “extension=php_mssql.dll” and I no longer get any errors. I had to search everywhere for this, and your little hint was extremely helpful!!! Thank you so much!

  96. Posted by tobias on November 21, 2010, 9:18 am

    Thanks a lot. It was really useful.

  97. Posted by Antonio Murillo on November 26, 2010, 12:29 pm

    Excelent post, following the steps it’s so easy thank you for your enormous help!!!!

  98. Posted by Maksim Yefremov on February 20, 2011, 12:24 pm

    The same problem as for Elena.

    All done as listed above. But instead of php execution it shows php plane source code: http://chipideil.orgi.biz/morfo/examples/getAllForms.php

  99. Posted by nadim on March 9, 2011, 3:13 am

    Hello,

    Locally i have a Windows Web Server 2008 machine on which I have installed IIS7, PHP5.3, etc (using Windows Web Platform Installer – http://www.microsoft.com/web/downloads/platform.aspx). When I test a PHP file in which there is only phpinfo() it works fine. When I try to include files from within my php files (using include(), require(), etc), I get the HTTP 500 Internal error. After trying several recommendations from forums (like this one), i’ve find a solution.

    I’ve downloaded PHP5.3.5 from http://www.blumentals.net/download/php.php and replaced the contents of the existing PHP (installed using Windows Web Platform Installer) with this one. Problem solved.

    nadim attari
    alienworkers.com

  100. Posted by Barks on March 9, 2011, 4:26 pm

    Thank you!!!

    Followed the steps and had php up and running on my shiny new 2008 R2 server in around 10 minutes.

    Many thanks for going to the trouble of writing this guide :) :)

  101. Posted by Scott S. on May 10, 2011, 10:35 am

    I’m having a problem getting PHP with FASTCGI working on a 2008 R2 Server. I was getting 404 errors that I found out are actually “No input file specified” errors.
    when just trying to browse to info.php I can browse to a normal html file no problem. I can run info.pgp from the command line just fine. thanks..

  102. Posted by roger on May 13, 2011, 12:57 pm

    Very very helpfull…thanks

  103. Posted by Web Site Design on July 10, 2011, 7:39 pm

    How about getting .html to be processed as a .php when PHP is installed as a FastCGI. I tried adding *.php, *.html but that didn’t work

  104. Posted by george on August 8, 2011, 4:00 pm

    Great instructions! Thanks.

  105. Posted by Larry Biederman on December 23, 2011, 1:47 pm

    Very Nice! I installed into Winswerver2008 R2, IIS7, using fastCGI and PhP 5.3.8.

    Some Buttons relocated to different positions, but install went flawlessly!
    Thanks Much!

  106. Posted by Asif Shehzad on February 9, 2012, 6:06 pm

    Thanx, its really work now my all PHP sites are working with IIS7.

  107. Posted by Manoj on February 15, 2012, 7:14 am

    The mysqli extension is missing. Please check your PHP configuration.

  108. Posted by viabfassy on April 6, 2012, 4:28 am

    When you really need stability: For those who have a dedicated hosting server then you’re on your own. You don’t have to talk about the actual host along with who else would have usage of ones machine. Consequently your complete info is safe. This kind of safety is not available in almost any server. In case you are using a discussed web server next many folks could probably read crucial computer data. In the case of Virtual private server this sysadmin can see your data yet on specific server there is finish to safeguard your data.

    Use of CPU strength: While you are over a VPS or over a provided host then a RAM, I/O means along with Central processing unit each one is distributed through different users. It often can happen that you end user could take upward every one of the Computer electrical power and also the functionality in the hosting server may get influenced negatively. In such cases you can not a single thing, in case you are well on an avid server the CPU works exclusively for your blog and when your server decreases and then you also would have treating the item.

    Overall performance with the server: In the matter of devoted host you would be alone to use all the sources in the host. As a result the particular functionality in the specific machine is excellent.

    However, understand that there are disadvantages in a dedicated machine furthermore. If you use a passionate server you’ll need to control which machine too in addition to handle its settings in addition to stability and in addition keeping track of. When it comes to contributed or perhaps VPS machine these kinds of effort is managed through sysadmin. For that reason, you need to have each of the technological knowledge to perform a separate web server.

  109. Posted by Kamran on April 23, 2012, 11:07 am

    Thanks Mike .. your hide extension suggestion worked. Beautiful!!!

    Kamran

    Posted by Mike Taylor on February 5, 2009, 12:22 pm
    Hello.

    Thank you for well made document. I was nicely done.

    I have Server 2008 and downloaded PHP 5.2.8. I followed your steps precisely, but I received a 404 error. Anyhow, I found the problem. My server settings, by default, was set to “hide extensions for known file types.” I unselected that option, removed the trailing .txt from the info.php file that was created, and there it worked.

Trackbacks

  1. Installing PHP on Windows and IIS | David’s Technical Musings
  2. new server « Citylights

Post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>