Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Install PHP Di Iis

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

Edit Article

How to Install PHP 5 for IIS 6


Community Q&A
Step by step guide on how to install iis6 and php5 on Windows XP or Windows Server 2003

Steps
1. 1
First you must install IIS 6.0. (IIS 5.1 on XP)
2.

2
On Windows XP, Go to your control panel > add remove programs. Click on
"Add/Remove Windows Components". Place a check for "Internet Information Services".
On Windows7 go to Start -> Control Panel -> Programs and Features -> Turn Windows

Features On or Off. Make sure that all the options showed on the below image are
checked.
3.

3
IIS 6.0 is now installed. Now you must get the correct files for php5. Head over to
http://www.php.net/downloads.php and download the zip package under "Windows
Binaries" Do not get the installer! In addition, while you are here you will need to get
the "Collection of PECL modules" also under Windows Binaries.

4.

4
Once Downloaded extract the first file you downloaded and place the files in
"C:\php". Extract the PECL modules to "C:\php\ext".

5.

5
Rename C:\php\php.ini-recommended to C:\php\php.ini and then COPY it to
C:\Windows

6.

6
Open both the php.ini file you have now and uncomment cgi.force_redirect in
php.ini and set it to 0

7.

7
Find SMTP = localhost and make sure it is un-commented. If your mail server is
somewhere else you may specify it here. Also set this line just below the above:
sendmail_from = someone@yourhost.com
8.

Change session.save_path as "session.save_path=C:\php\sessions" and make the


directory C:\php\sessions
9.

9
Set the line "extension_dir" as "extension_dir = "C:\PHP\ext".

10.

10
Uncomment all of the following items.
extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_java.dll
extension=php_ldap.dll
extension=php_iisfunc.dll
extension=php_imap.dll
extension=php_filepro.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_dba.dll
extension=php_dbase.dll
extension=php_dbx.dll
extension=php_mbstring.dll
extension=php_pdf.dll
extension=php_pgsql.dll
extension=php_sockets.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll

extension=php_zip.dll
The rest require more attention and is out of the scope of this tutorial. Some of the
items might not be there. In that case, simply copy the line to your ini file.
11. 11
Now copy all of those DLL files in C:\php\ext to C:\windows\system32 or add
"C:\PHP;" to your Windows path. To add php to your Windows path:
o Right Click on My Computer and choose properties > Advanced Tab > Click
"Environment Variables".

o Now add "C:\PHP;" to the very beginning.

o Now go to start > run > type: regedit and click OK.

o Add HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath = C:\php to the


registry. If you change your windows path instead of copying the dll files then
you will need to restart your computer before php will work. Updating php is
easier when you add it to your Windows path. So bookmark this page and go
restart. Now is the best time since we are done with file placement.

o From the IIS Manager, click on the hostname of your server in the Connections
panel on the left.

o Double-click on the Handler Mappings icon.

o From the Handler Mappings Actions panel, click on Add Module Mapping.

12. 12
Type the following information into the appropriate text boxes, and then click OK.
o Request path: *.php

o Module: FastCGImodule

o Executable: C:\php\php-cgi.exe

o Name: FastCGI

o Click OK, and then click Yes.

o In the left panel, click on your servers hostname, and then double-click on the
Default Document icon.

o From the Actions panel on the right, click Add.

o Enter index.php as the new default document name, and then click OK.
o In the left panel, click on your servers hostname.
o In the Actions panel on the right, click Restart.
o Create a new text document, and save it as c:\inetpub\wwwroot\phpinfo.php with
the following content:<?php phpinfo(); ?>
o You should now see the PHP information page at http://localhost/phpinfo.php.

You might also like