Articles
Installing PHP 5 on IIS in 5 simple steps
Configure PHP.ini
You could very easily write a series of articles regarding setting the various php.ini directives, so to try and keep this article short I will just deal with the basics here. When serving PHP on IIS the php.ini file is the only place that options are set, and if no php.ini file can be found then the defaults are loaded. The limitation of a single php configuration for an entire server is perhaps one of the biggest disadvantages with hosting PHP applications on IIS, especially in shared hosting environments.
There are actually only a handful of setting you will might want to look at configuring in php.ini, and they are the path to your extensions, sessions, and upload directories. You'll also may wish to enabled a few PHP extensions to get added functionality from PHP that might be required by some PHP apps, and perhaps set some PHP logging options.
- Open your PHP installation directory (e.g D:\PHP) and copy php.ini-recommended and rename the copy to php.ini
- Open php.ini and do a search for extension_dir = "./" and replace it with extension_dir = "D:\PHP\ext" where D:\PHP\ext is the path to your extensions directory (it's the one with all the files that begin with "php_" in it). The path to your PHP installation will be used for the next several steps, so take care that you modify them to suit your own environment.
- Search for ;session.save_path = "/tmp" and replace it with session.save_path = "D:\PHP\sessions" (note the semi colon (;) is removed). This will be used to store PHP session information which is used by many PHP applications.
- Search for ;upload_tmp_dir = and replace it with upload_tmp_dir = "D:\PHP\upload" (note the semi colon (;) is removed). This is used for all your HTTP upload files, and if not set your system temp will be used.
- Search for ;error_log = filename and replace with error_log = "D:\PHP\log\php.log" (note the semi colon (;) is removed). This is where all your PHP logging information is kept when enabled. You can also configure PHP to log data to your Event Log, but it requires loosening the privileges on the IUSR_COMPUTERNAME account IIS uses.
- Search for ;extension=php_mysql.dll and remove the semi colan (;) from infront of it so it appears as extension=php_mysql.dll. You'll almost certainly need this PHP extension loaded as any PHP application that uses the MySQL database will need it.
- Add new comment
- 743427 reads

Comments
Nice one Matt! Just for
Nice one Matt! Just for future reference you'll find that restarting your application pool (if using IIS 6/7) or restarting IIS will be enough to apply your changes in php.ini.
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
Thank You
EXCELENT !!
Very well written ,everything worked fine for me in the 1st try itself . . .Thanks to you
An exilent overhaul!!!
Thank you so very much.
At last - you - made it happen.
/Magnus
PECL Win32 binaries
I looked all over and I cannot find:
(1) Any idea of what PECL Win32 binaries are, and
(2) The to download.
I was able to download the Win32 binaries, but the cited web page has absolutely no mention of PECL Win32 binaries other than the fact that they are NOT included with the Win32 binaries!
How do I get the PECL Win32 binaries?
What are the PECL Win32 binaries?
rrr
Total Newbie - Didnt Work
I wasencouraged reading this tutorial. It took some time to find the PECL whatchamacallit, nbut I was able to perform all of the steps finally.
Then I restarted IIS, went into explorer, clicked on the phpinfo.php file, and got the "Windows does not recognize this extension" box.
I really know next to nothing about IIS and we4b servers in general, so I do not know where to go next to get PHP to work,.
Machine is Windows XP SP3 and IIS is 5.1
I downloaded the following from the PHP sites:
php-5.2.8-Win32.zip (extracted to C:\PHP)pecl-5.2.6-Win32.zip (extracted to C:\PHP\ext)
The Websites properties Home Directories/Configuration has the file extension of ".php" set for the dll: "C:\PHP\php5isapi.dll". Both checkboxes mentioned are checked.
Help!
rrr
No PECL release for 5.2.8, use PECL release for 5.2.6
Obviously you figured out that there is no PECL release for PHP 5.2.8, and that you should use the PECL release from PHP 5.2.6.
Sounds like you are very close with your PHP configuration. The one issue I can see that you are doing is that you are accessing your phpinfo.php file directly via windows explorer. By doing this you effectively bypass IIS, so the php script is never processed. Think of it like your php files only speaks Japanese, your Internet browser only speak English, and IIS is the interpreter.
Assuming you have placed your phpinfo.php file in the root of you IIS website, then what you need to do to have IIS process you php files is to open you internet browser and type in http://localhost/phpinfo.php into the address bar. This is also assuming that you are using an Internet browser on the computer that IIS and PHP are installed on.
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
Thank you!
Thank you, thank you, thank you.
This is the best, most concise, and well written guide for installing PHP on IIS....and it works!
PECL Win32 Binaries
http://snaps.php.net/win32/
Download "pecl5.1-win32-latest.zip"
Getting the Blank screen after php installation
Hi
I am installing php 5.2.8 on iis 5.1
after installation i am getting blank screen
what could be reason
give suggestions
Thanks,
Abhishek
I take it you are just
I take it you are just trying to do a phpinfo() ? If not, this should be the first thing to try after an install to verify that it is working. I'd recommend opening your php.ini and setting display_errors to on. This way any issues should be displayed in your web browser.
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster