Articles
Installing PHP 5 on IIS in 5 simple steps
Restart and verify
Almost done now. Restart your server so that all the changes we have made are made effective in one swoop. Once your server has restarted create a file called phpinfo.php and place it in one of your websites that you can get access to. Open the file and enter this code;
<?php
phpinfo();
?>
Save the file and then open your web browser and access you phpinfo.php file and you should be presented with a screen detailing your PHP configuration. If this is what happens then you are up and running, if not then something has gone amiss. Feel free to ask me for help in the forums though.
As already stated if you require PHP 4 (for legacy code, etc) then your job is much easier. Just Download the IIS Aid PHP Installer and run through the GUI based installation wizard and everything is setup for you. With PHP now enabled you are on your way to being able to utilize one of the most popular web scripting languages in the world, which is used by thousands of free, and commercial web applications. Be sure to check back on this site in future for some PHP tuning tips and performance comparisons to make sure you are getting the most out of your PHP environment.
- Add new comment
- 743318 reads

Comments
You have definitely
You have definitely uncommented php_mysql.dll in your php.ini file? If so, then have a look at the path for the "Loaded Configuration File" value near the top of your phpinfo page. Is this correct?
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
Excellent Guide
Thanks a lot for such a excellent and elaborative guide. Really helpful.
Regards
Problem installing on IIS 7
Hi, and first thank you for this nice guide.
However I have problems installing on IIS 7 as the interface is really different from previous versions and I am far from beeing a specialist in configuring IIS.
I did evrything you said (at least I think so) but I have a 404.17 - Not found error when calling the phpinfo.php page.
Detail error should be something like "aked content seems to be a script and won't be handled by the static file manager".
Sorry if that message seems weird but it is a translation as my system is in French.
Just for information the web site works correctly if I call an .htm or .aspx(.net) file.
If you have any hint...
installed aid to server 2008 with iis 7
and got problems.
well, before I could run php for all sites. PHP had been installed manually form php distributive. but I couldn't run smarty.
Today I thought to implement Aid tool. First removed php and installed tool. The first strange thing I sat that it said me that Fast-CGI is not installed. It was! And offered use ISAPI. ok. Asked to direct all php sites. Directed.
In result now I can't run any site having error:
HTTP Error 404.2 - Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.
•No handler mapping for this request was found. A feature may have to be installed.
•The Web service extension for the requested resource is not enabled on the server.
•The mapping for the extension points to the incorrect location.
•The extension was misspelled in the browser or the Web server.
Checked according these directions. Everything looks ok but still nothing works. What to do now?
Help please!
Almost working
Hi,
First of all, it's nice to see some dedicated person sharing his knowledge with the community. Great work.
Now with my problem.
I am using Windows XP Pro SP3
IIS 5.1 and PHP 5.2.6.6.
I got the PHPInfo.php working fine.
But when I call a .php page from a button, only the code of the .php appears. I have been working for the last 2 days on this problem, but can't seem to find the solution. I checked, double checked and triple checked everything, uninstall IIS and PHP. I did the reinstall to get the same result.
I also must say that I tried to install php 5.2.6.6 with the Apache 2.2 before but had similar problem. The only difference is that it prompted me to download or save the file instead.
Any thought about this ?
Thank you for reading this.
Pierre
Almost working part 2
Hello again,
Well I think I have the solution to my problem. Would like your advice if it is normal.
When I access my file like this (http://localhost/Exercice1PHP.html) and click on the cmd button everything works fine but when the page is accessed like this (C:\Inetpub\wwwroot\Exercice1PHP.html)this is when I get this:
Le garage de Bob
Résultats de la commande
echo '
Commande traitée.';
?>
as a result.
So, is it right to say that when working on the local server, the address always has to start with HTTP://localhost/ or HTTP://127.0.0.1/ ?
Hope to hear from you soon
Best regards,
Pierre
Hi Pierre, This is actually
Hi Pierre,
This is actually quite a common issue. PHP is an interpreted script, meaning it must be proceesed by either PHP CLI or a webserver configured to process PHP content into a format that can be rendered by your browser. When you access your PHP scripts locally using http://localhost or http://127.0.0.1 you are invoking your locally installed webserver to proccess the requested content. When you try and access these scripts directly (i.e C:\Inetpub\wwwroot\Exercice1PHP.html) then you bypass your webserver and the PHP script is not executed.
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
Directories
So if I want to work on more than one project, how do I manage my files. I tried to create directories, but the page pages won't show at all. I have the HTTP 404 error(can't findthe page). Exemple http://localhost/PHP/chapitre2/orderform.html
But when I but the page directly in the wwwroot folder like this http://localhost/orderform.html it is working fine.
Is there a way I can use so I don't put all my files in the same directory?
Thanks again for your assistance. greatly appreciated
Pierre
404 could mean permissions
WHen you've confirmed that the files are definately there and are sure the path is correct, then a 404 error usually translates to there being a dile permissions issue. Ensure all you web files have at least NTFS read permissions to your IIS user account (usually IUSR_COMPUTERNAME).
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
WHen you've confirmed that
WHen you've confirmed that the files are definately there and are sure the path is correct, then a 404 error usually translates to there being a dile permissions issue. Ensure all you web files have at least NTFS read permissions to your IIS user account (usually IUSR_COMPUTERNAME).
I have tried and couldn't get it working. Any other ideas ?
Would the fact that I have Visual Studio.Net 2008 installed be the cause as it also use IIS.