Sunday, 14 June 2009

Install IIS and configure it with php


Because php is a server-side scripting language, it needs a web server to run its scripts. The most widely used Web Servers are Apache and Internet Information Services (IIS). Apache mainly used on Mac OS X, Linux and Unix platform. And IIS is widely used on Windows platform. In this tutorial I'll show how to install IIS and configure it with php. So lets start...

1. Enter your Windows XP CD/DVD rom into your CD/DVD drive. After appering the setup window click exit.

2. Go on to the Control panel and and select "Add or Remove Programs" icon. In the Add/Remove window select "Add/Remove Windows Componet" button on the left pane. A setup wizard will appear. Which is shown below:



3. From this wizird select the IIS check box and click the detais.. botton and select the all check box so that any componet should not missed. Now click Next and after successful installation click Finish button. Now IIS is installed on your computer.

4. Now go on to the Control panel and select "Administrative Tools" and then select IIS. IIS window will appear.

5. On the left pane open up "Default Web Site" menu and right click it and select properties. Just like figure below:



6. Default Web Site Properties will appear. Which looks like below:



7. Click the "ISAPI" Filters tab and click the add button. Create a new filter called PHP. And in the executable field select the file "php5isapi.dll" in the C:\php\ directory. To select this file click browse button and select this file in the above directory and then click ok. See the figure below:



8. Now go on to the Home Directory button select the configuration button and select the Add button. In the executable field browse the file "php5isapi.dll" just like above and in the extension field type ".php" and click ok. Which is shown in the following figure:



9. Keep all this configuration and click apply and then ok. Restart the window.

10. Now you've configured IIS with php and you're ready to start php scripting. To test a php script, open Notepad and type the code below:

phpinfo();
?>

And save it into to the "C:\intpub\wwwroot" directory. This directory is called "Web directory". All your php files must be in the web directory unless your web server can't find them. Make sure that your file extension must be .php such as "test.php".

11. Open up your browser and type "http://localhost/test.php" in the address field. The php's all information window will appear. Which is shown in the following figure:



If you see this window, php is perfectly installed and configeured it with IIS on your computer. Now ready to start php scripting and enjoy!!.

Thanks for watching this tutorial.

No comments:

Post a Comment