Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

August 17th, 2007, 14:35 GMT · By Adrian Placinta

How to install PHP on IIS

SHARE:

Adjust text size:


Configuration steps
Enlarge picture
Today we'll learn how to install PHP for IIS in Windows XP Pro. First we need to download PHP and install IIS.

To install IIS, you need the Windows XP installation CD. Go to Control Panel-> Add/Remove Programs and click on Add/Remove Windows Components. Check Internet Information Services (IIS) and insert the CD with Windows Xp. After that, press Next and wait until IIS is installed.
Next, extract the file from php archive to c:/php/. Copy php5ts.dll to the web server's directory (C:/inetpub/wwwroot) and Windows system directory (C:/windows/system32).

The second step is to set up the config file for PHP, php.ini. Rename php.ini-dist to php.ini and copy the file to windows folder: C:/Windows. PHP stores in php.ini all the configurations and if you want to install, for example, an extension, you will need to modify this file. Edit php.ini in wordpad and replace doc_root= with doc_root = "C:/inetpub/wwwroot/" and also check if cgi.force_redirect = 0

The third step is to add c:/php to environment variables PATH. For that, right-click on My Computer and choose Properties. Go to Advanced Tab and click the Environment Variables button. In system variables find the variable PATH. There, go to the end of the line and add an ";" and type C:/php. Click OK here and for the Environment Variables. We need to reboot the computer to activate the changes.

The fourth step is to configure IIS to work with PHP. Go to Control Panel -> Administrative Tools -> Internet Services Manager and start IIS. Right click on Default Server and choose Properties. Go to Home directory, set "Execute Permissions" to "Scripts Only" and click Configuration. Click Add, choose Executable C:/PHP/php5isapi.dll and set Extension to .php. After that, go to Isapi Filters, click Add and set Filter Name to PHP and Executable to C:/PHP/php5isapi.dll. Click Apply and then OK. Restart IIS and we're done.

To test the installation, create a new document in wordpad, paste this text and save it as phpinfo.php. Copy the file to C:/inetpub/wwwroot. Open your browser and type http://localhost/phpinfo.php

TELL US WHAT YOU THINK:

33,352 hits · 9 comments · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


New Income for Website Hosting Providers

Microsoft Finally A Winner, Beats The Vulnerable Apache

Microsoft Grows by 2.6 Million Websites in Just 1 Month

Manually Configure PHP5 and Apache2

READER COMMENTS:


Comment #1 by: Aaron on 19 May 2008, 01:58 UTC reply to this comment

Very good. Just remember to change the backslashes to forward slashes


Comment #2 by: Tom on 18 Jul 2008, 17:40 UTC reply to this comment

I love the step by step example and followed it to the letter, but still cannont get my PHP pages to display on Windows XP. HTML pages work just fine, but I still get 404 errors with the PHP pages. Any suggestions?


Comment #3 by: hapman on 09 Feb 2009, 12:23 UTC reply to this comment

Very good. Just remember to change the backslashes to forward slashes


Comment #4 by: Rattanak on 02 Apr 2009, 03:49 UTC reply to this comment

i have followed the instruction but i still have problem with the step 4,At the place that we set extension " .php" . when i press button OK, there was a message shown " this extension is already used, try another extension". What does it really mean?


Comment #5 by: samuraisimon on 29 Jul 2009, 18:02 UTC reply to this comment

Thanks a lot! After 2 day searching i finally find the right answer


Comment #6 by: Vijay Prakash on 12 Nov 2009, 12:21 UTC reply to this comment

Guys,

Above steps NOT works for me in server 2003

I tried below link its working fine

http://knol.google.com/k/neale-petrillo/how-to-install-php-5-2-on-windows/8r3gldybk57h/3#

Cheers!

Regards,
VP


Comment #7 by: bob on 05 Dec 2009, 10:18 UTC reply to this comment

The files that you download in the PHP link bear no resemblance to the files discussed in the topic. A complete waste of time that actually sets you back...


Comment #8 by: KSJeyaseelan on 30 Sep 2010, 06:21 UTC reply to this comment

Thanks for your Article
I install Php in windows xp by using this..For your info use \ instead of / in path.


Comment #9 by: immo on 24 Jun 2011, 11:38 UTC reply to this comment

it was great fun installing php

Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM