Manual Installation Tutorial for PHP 5 on IIS 5.1 (Windows XP Pro)

January 13th, 2010 by PHP Tutorials Leave a reply »

Prerequisite: IIS (web server) installed. There is a link to an IIS installation tutorial at the end of this article

Before we begin any installation steps, the first thing we will need to do is download the PHP zip file from PHP.net (www.php.net/downloads.php). The version available at the time of this publishing is 5.1.4.

The first step is to extract all of the files from the downloaded zip file into C:PHP (create the folder if it doesn’t already exist). You may choose a different location, although it is not recommended. The path must NOT have spaces, for example, you cannot use C:Program FilesPHP. Some web servers may not be able to handle the path name and will fault.

PHP 5 includes a CGI executable, a CLI executable as well as the server modules. The DLLs needed for these executables can be found in the root of the PHP folder (C:PHP).

php5ts.dll needs to be available to the web server. To do this, you have 3 options:

1. Copy php5ts.dll to the web server’s directory (C:inetpubwwwroot).

2. Copy php5ts.dll to the Windows system directory (C:windowssystem32).

3. Add the PHP directory path to the environment variables PATH.

We will go with option 3, because we would like to keep all of our PHP install files in the same location, for easier cleanup later, if needed. Let’s proceed…

Instructions on how to put C:php in env variables PATH.

First we want to open System Properties. There are two ways to get to System Properties. Either way will work.

1. Right-Click on My computer and choose “properties”.

2. Go to Control Panel, and select “System”.

Once here, we want to select the Advanced tab. In the Advanced tab, click the “Environment Variables” button. There are two sections in the Environment Variables window, User Variable and System Variables. We will be using System Variables. Scroll down in System Variables until you find the variable PATH. Highlight that line and the select Edit below the System Variables window. We will only be adding to the Variable Value. BE CAREFUL HERE. You do not want to delete anything on this line. Simply find the end of the line and add a semi-colon ( ; ) if there is not one already. After the semi-colon, type: C:PHP and then hit OK. Now click OK on the Environment Variables window. Finally click OK on the System Properties window and we are done with this part.

Now we must restart the computer to make the Environment Variables changes come into play. We cannot simply log off and log on, you must restart.

The next step is to set up a config file for PHP, php.ini. In C:PHP you will find two files named php.ini-dist and php.ini-recommended. We will use php.ini-recommended for this install, and all you need to do is rename it from php.ini-recommended to php.ini.

1. doc_root = C:inetpubwwwroot

2. cgi.force_redirect = 0

Now PHP is installed, lets move on to preparing our IIS to use PHP.


Configure IIS to use PHP.

1. Open IIS

2. Under Home Directory: Set “Execute Permissions” to “Scripts Only”

3. Click on configuration..

a. Click Add

b. Set “executable” to C:PHPphp5isapi.dll

c. Set “extension” to .php (don’t forget to include the . )

d. Click OK

e. Click Apply, then OK.

Under ISAPI Filters

a. Click “Add”

b. Set Filter Name to PHP

c. Set Executable to C:PHPphp5isapi.dll

d. Click OK.

e. Click Apply, then OK.

Restart the Web Server

Now we want to test PHP on our system. To do this, we will create a file called phpinfo.php and it will be used to display all of the PHP info from our system in our web browser.

1. Open Notepad and type:

&amp;lt;?php echo phpinfo();<br>?&amp;gt;

2. Save the file as phpinfo.php and select the file type ‘All Files’(Important: do not save the file as .txt, as it will not work).

3. Move the file into C:inetpubwwwroot

4. Open your web browser and type: [http://localhost/phpnfo.php]

5. Your browser should display a lot of PHP information.
Click here for IIS installation tutorial. [http://www.studiothreehundred.com/viewarticle.php?id=45]

Congratulations! PHP is now installed and configured on your machine. You can now start building dynamic web pages.

Chris Alexander is a freelance web designer for StudioThreeHundred.com. For more tutorials visit StudioThreeHundred.com

Related Posts On PHP Tutorials.net

Advertisement

66 comments

  1. I think you made some good points.

  2. This is a nice site. I check here frequently and you have always interesting updates, regards!

  3. Very good blog post I like your website keep up the amazing articles

  4. Adore the newest look. I enjoyed this great article. Thanks for the excellent work.

  5. Len Lanton says:

    I thought all the income made from web are scams. Now, i know and im enlightened.

  6. Elisha Broks says:

    Stumbled across your article while seeking via yahoo. I read the very first paragraph and its great! I don’t have enough time to finish it now, but I have bookmarked your internet site and will go through the rest tonight. : )

  7. Forex Inside says:

    Читаешь это и думаешь….

  8. Сайт отличный, буду рекомендовать знакомым!

  9. Сайт просто отличный, порекомендую всем знакомым!

  10. ocljlwijlmcds says:

    ocljlwijlmcds

  11. Полезно, спасибо

  12. FilmFox says:

    “good post”

  13. Сенкью, полезная инфа! ;)

  14. Повар says:

    Красота, особенно первая фотка

  15. Категорически не согласна с автором))

  16. koshelek says:

    “Блог в ридер однозначно”

  17. Сталкиваясь с проблемой выбора (совершаем ли мы крупную покупку или покупаем приятную безделушку), нам важно знать о качествах товара. Разобраться во всем многообразии товаров либо услуг помогут советы экспертов, которые можно найти в каждой статье, размещенной на этом сайте.

  18. Apple says:

    Не пойму в чём дело, но у меня тока 2 картинки загрузилось. ((( А ваще понравились! :)

  19. пытаемся читать между строк..

  20. i wouldn’t have considered this was great a couple years in the past yet somehow it is crazy the way in which time varies the manner in which you see a mixture of ideas, many thanks regarding the article it happens to be pleasant to see some thing smart occasionally instead of the widely seen crap mascarading as information sites on the net, cheers

  21. Не пойму в чём дело, но у меня тока 2 картинки загрузилось. ((( А ваще понравились! :)

  22. i was starting to believe that i could possibly be the only woman which thought about this, at the very least at present i realize im not outlandish :) i am going to be sure to find out more about a couple of several other posts soon after i get a tad of caffeine in me, it’s stressful to read without my coffee, cheers :)

  23. “Работай с умом, а не до ночи”

  24. Автор выйди к напроду, вопросы есть!

  25. Спасибо за пост, только почему не пишите последние пару дней? Мы же ждем продолжения :) +1 полностью согласен с Антоном!

  26. alconavt says:

    Спасибо за чудо))

  27. круто..взяла почти все))

  28. Жора says:

    Не знаю как вам, а мне нравится! Вот.

  29. theresa says:

    Just stopping by and giving my props to another marketer who posts about search engine listings.

  30. Viper says:

    “Спасибо за такой пост”

  31. Pedross says:

    Спасибо за чудо))

  32. Микро says:

    Категорически не согласна с автором))

  33. Насос says:

    фантастика!…

  34. Bentley says:

    Не знаю как остальным, а мне понравилось.

  35. “Очень познавательно”

  36. ATMOS says:

    Очень интересно!!! Только не очень могу понять как часто обновляется ваш блог?

  37. ммм)) так клёво))

  38. Трипо says:

    Организация «Профстройреконструкция» – предоставление высококачественных услуг: Изучение специфических свойств.

  39. max says:

    Автор, у тебя записи никто не крадет c блога? А то меня достали уже – тырят и тырят. Только тем и занимаюсь что нахожу их…

  40. kcrdktofobp says:

    czisPv jrftlgsjqnvq, [url=http://cdfsmjxljtmy.com/]cdfsmjxljtmy[/url], [link=http://pkiapnaplwqo.com/]pkiapnaplwqo[/link], http://bzeeajenqvla.com/

  41. rhcqvmnio says:

    ZPULXu smmextrfqbrl, [url=http://xtyqlwbmxnhc.com/]xtyqlwbmxnhc[/url], [link=http://fwgrwkcjfldi.com/]fwgrwkcjfldi[/link], http://wqexjqlbqwti.com/

  42. xjilxwyq says:

    GCRnIl fybutcsoounu, [url=http://mhbvkolwnciy.com/]mhbvkolwnciy[/url], [link=http://wtotkctswusp.com/]wtotkctswusp[/link], http://hiytnsiiozti.com/

  43. mfwjbij says:

    frt41j zjdhkaiqsnja, [url=http://rakkclruxawy.com/]rakkclruxawy[/url], [link=http://fjdpnrfsovip.com/]fjdpnrfsovip[/link], http://jnmxnzlvytut.com/

  44. TranceParty says:

    Забавно. :-)

  45. Эх… :) Вы бы знали что про Вас пишут в других блогах :)

  46. пиво says:

    Сегодня даже опытный потребитель невольно испытывает легкое головокружение от обилия современных товаров либо услуг, настолько они разнообразны. В материалах сайта – советы специалистов, работающих в сфере товаров и услуг, прочитайте статьи, и проблема выбора потеряет свою остроту.

  47. informative post. I hope you keep on writing such interesting stuff

  48. Ура! С 2009 всех блогеров!

  49. Компания “СтройТехноИзоляция” – производство качественных материалов: Пенополиуретан.

  50. Красота, особенно первая фотка

  51. Да, интернет – огромен, если и такое даже можно найти ;)

  52. “Очень хороший”

  53. Енот says:

    “Мне нравятся Ваши посты”

  54. Modalogia says:

    ммм)) так клёво))

  55. Как-то непонятно изложено… Кто-нибудь понял суть этой статьи ?

  56. MazaHaka says:

    “здорово!”

  57. I really loved reading this specific article. I most certainly will be returning to browse some more intriguing ideas. Regards.

  58. класс)мне понра)особенно!

  59. Виват says:

    Эээ, а объясните, плиз, а то я че-то не совсем въехал, это как?

  60. Яой says:

    Сайт отличный, буду рекомендовать знакомым!

  61. Ой, благодарю.

Leave a Reply