Installing PHP 5 on IIS in 5 simple steps

Categories:

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.

Comments

Anonymous's picture

THE BEST GUIDE FOR PHP

THANK YOU

Anonymous's picture

BEST GUIDE

THANK YOU!!! your last comment fixed my problem!! Very good thinking and analysing of problems through posts, which my lecturer couldnt solve in 10 emails. Keep it up!!

Anonymous's picture

Great Guide

This tutorial was a life saver. I attempted to install php 4 times before coming across this guide which was the first that I could follow from beginning to end. Much appreciated.

Anonymous's picture

Only one thing missing

I had to enable read access to php5isapi.dll on IUSR_. Won't everyone have to do that?

Brashquido's picture

You shouldn't have to give

You shouldn't have to give read access to the IUSR account unless the default permissions have been altered. Have you removed any of the default permissions from your PHP directory?
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

Excellent Guide for Beginners Like me.

This page is an excellent guide for new programmers. After installing php5 on IIS5 I spent many days breaking my head to make it work. Many other guides didnt help. Thanks to Dominic Ryan. KEEP IT GOING
John

Anonymous's picture

Good Job But can you explain how to do it with Fastcgi Go live?

I think also this is a excellent guide.
But with so many expectations about using Fastcgi GoLive I would like your help about installing PHP 5.2 using FastCgi on Windows 2003
Thanks
AT

Anonymous's picture

The php code isn't executing

Dude, tks a lot for your tut. I've done everything right. I tested the installation with the "test.php" page and it is displayed correctly. The only (but a terrible headache) problem is that every single page with .php extension isn't showing.

I mean, when i try to visualize some php page, my browser only displays a blank page, and nothing it''s working. I have checked my server, and everything is fine. Can anyone helpe me?

Brashquido's picture

I'll look at putting

I'll look at putting together a FastCGI guide this week, or next week at the latest.

If you are getting blank pages, then you might like to make sure that your error reporting in php.ini is turned on. In particular make sure you have these settings;

error_reporting = E_ALL

display_errors = On

----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

HTTP 500

Hi, nice guide there, though i have some problems
On execution of any PHP file, i get the HTTP 500 error, and IE7 wont give me more details. Im using WinXP Pro, IIS5.1 and PHP 5.2. Also i got MySQL 5.0 installed. my main reason for installing PHP on my IIS server is for vBulletin, though i cant seem to run any PHP application. Mappings are correct, Environment Variables are correct too, though i installed PHP in "C:\Program Files\PHP" and i got an error to put quotes around the address when making the mapping, and instead of the normal format: C:\windows\inetserv\asp.dll, my PHP executable is in qutoes because of the between 'Program Files': "C:\Program Files\PHP\PHP5isapi.dll"
Any help will be greatly appreciated, ill be waiting for a response