How to Enable/ Install PHP on IIS


Follow the Following steps:
1. Install IIS Server on your windows machine
For Windows XP
2. Then go to your control panel > add remove programs. Click on "Add/Remove Windows Components". Place a check for "Internet Information Services".
For Windows Server 2003
3. On Windows Server 2003 Go to your control panel > add remove programs. Click on "Add/Remove Windows Components". Place a check for "Application Server" and click on the details button. Here you want to make sure there is a check for "Internet Information Services". You can also add ASP.net very easily here.

4. IIS 6.0 is now installed. Now download PHP 5 Files at 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.

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

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

7. Open the php.ini file and uncomment cgi.force_redirect in php.ini and set it to 0

8. Find SMTP = localhost and and uncomment it if not. If your mail server is somewhere else you may specify it here. Also set sendmail_from = someone@yourhost.com
9. Change session.save_path as "session.save_path=C:\php\sessions" and make the directory C:\php\sessions

10. Add a line "extension_dir" as "extension_dir = "C:\PHP\ext".

11. Uncomment the follow lines.

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


12. Now copy all of those DLL files in C:\php\ext to C:\windows\system32 or add "C:\PHP;" to your Windows path.

13. Adding php to your Windows path
i). Right Click on My Computer and choose properties > Advanced Tab > Click "Environment Variables".
ii). Now add "C:\PHP;" to the very beginning.

14. Now open registry. It can be done by
Click on tart > run > type: regedit and click ok

15. 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.
16. Now Open Internet Services Manager in your Administrative Tools in the start menu.
17. (This step is only needed for Windows 2003/IIS 6, not for Windows XP/IIS 5.1.) Right Click on Web Service Extensions located on the left hand side and choose Add a new web service extension. Enter in php and click add. Browse to C:\php\php5isapi.dll. Also set extension status to allow. Click ok.
18. Right Click on websites and choose properties. Go to the Documents tab and add index.php as a start document. Go to the Home Directory Tab and click on Configuration. Now go to the mappings tab and click on add. Enter .php for the extension and enter "C:\php\php5isapi.dll" in the executable textbox. Make sure all verbs is checked and click ok, click ok, click ok. You are done installing it. Now you need to test it.
18 Go to C:\Inetpub\wwwroot and delete everything in there except for aspnet_client. Now make a new text file and name it phpinfo.php. Open it up with your text editor ant put this in it:
.
19 Open a web Browser and go to
http://localhost/phpinfo.php
20 If you followed all the instructions, it should work fine.


Related Topic What are all Common use of SSH for UNIX and Linux systems
How to Setup Peer to Peer Home Network
How to Setup Broadband Connection and File Sharing
How to Setup Apache 2 HTTPS web Server Configuration
How to Enable and Disable Apache Web Server Modules
PHP  IIS  

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback