How to Install PHP 5 for IIS
First you must install IIS 6.0., On Windows XP, Go to your control panel > add remove programs., IIS 6.0 is now installed., Once Downloaded extract the first file you downloaded and place the files in "C:\php"., Rename C:\php\php.ini-recommended to...
Step-by-Step Guide
-
Step 1: First you must install IIS 6.0.
(IIS
5.1 on XP) , 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. , 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. , Extract the PECL modules to "C:\php\ext". ,,, If your mail server is somewhere else you may specify it here.
Also set this line just below the above: sendmail_from = [email protected] ,,, 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.dllThe 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. , To add php to your Windows path:
Right Click on My Computer and choose properties > Advanced Tab > Click "Environment Variables".
Now add "C:\PHP;" to the very beginning.
Now go to start > run > type: regedit and click OK.
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.
From the IIS Manager, click on the hostname of your server in the Connections panel on the left.
Double-click on the Handler Mappings icon.
From the Handler Mappings Actions panel, click on Add Module Mapping. , In the left panel, click on your server’s hostname, and then double-click on the Default Document icon.
From the Actions panel on the right, click Add.
Enter index.php as the new default document name, and then click OK.
In the left panel, click on your server’s hostname.
In the Actions panel on the right, click Restart.
Create a new text document, and save it as c:\inetpub\wwwroot\phpinfo.php with the following content:<?php phpinfo(); ?> You should now see the PHP information page at http://localhost/phpinfo.php. -
Step 2: On Windows XP
-
Step 3: Go to your control panel > add remove programs.
-
Step 4: IIS 6.0 is now installed.
-
Step 5: Once Downloaded extract the first file you downloaded and place the files in "C:\php".
-
Step 6: Rename C:\php\php.ini-recommended to C:\php\php.ini and then COPY it to C:\Windows
-
Step 7: Open both the php.ini file you have now and uncomment cgi.force_redirect in php.ini and set it to 0
-
Step 8: Find SMTP = localhost and make sure it is un-commented.
-
Step 9: Change session.save_path as "session.save_path=C:\php\sessions" and make the directory C:\php\sessions
-
Step 10: Set the line "extension_dir" as "extension_dir = "C:\PHP\ext".
-
Step 11: Uncomment all of the following items.
-
Step 12: Now copy all of those DLL files in C:\php\ext to C:\windows\system32 or add "C:\PHP;" to your Windows path.
-
Step 13: Type the following information into the appropriate text boxes
-
Step 14: and then click OK. Request path: *.php Module: FastCGImodule Executable: C:\php\php-cgi.exe Name: FastCGI Click OK
-
Step 15: and then click Yes.
Detailed Guide
(IIS
5.1 on XP) , 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. , 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. , Extract the PECL modules to "C:\php\ext". ,,, If your mail server is somewhere else you may specify it here.
Also set this line just below the above: sendmail_from = [email protected] ,,, 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.dllThe 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. , To add php to your Windows path:
Right Click on My Computer and choose properties > Advanced Tab > Click "Environment Variables".
Now add "C:\PHP;" to the very beginning.
Now go to start > run > type: regedit and click OK.
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.
From the IIS Manager, click on the hostname of your server in the Connections panel on the left.
Double-click on the Handler Mappings icon.
From the Handler Mappings Actions panel, click on Add Module Mapping. , In the left panel, click on your server’s hostname, and then double-click on the Default Document icon.
From the Actions panel on the right, click Add.
Enter index.php as the new default document name, and then click OK.
In the left panel, click on your server’s hostname.
In the Actions panel on the right, click Restart.
Create a new text document, and save it as c:\inetpub\wwwroot\phpinfo.php with the following content:<?php phpinfo(); ?> You should now see the PHP information page at http://localhost/phpinfo.php.
About the Author
Sophia Griffin
Brings years of experience writing about DIY projects and related subjects.
Rate This Guide
How helpful was this guide? Click to rate: