Configuring PHP5 to run on IIS6.
(Windows Server 2003)
About PHP5.
PHP5 is an "Open Source" scripting language and provides similar functionality to Microsoft's ASP. Obviously, both have their advantages and a comparison of the two technologies is outside the scope of this tutorial. However, a common misconception is that PHP is "Linux only" and not compatible with Microsoft systems.
To find out more about PHP, visit the following site:
http://www.php.net
1. Getting the PHP5 package.
(Please note that later versions may be available as you read this) The ZIP package is the preferred option (when compared with the Installer) simply because it includes greater functionality and extensions. However, this should be obvious from the much greater download size. | ||
2. Extracting the files:
Unzip the PHP archive to C:\PHP5 then copy "php5ts.dll" (highlighted in Figure 1 above) into C:\Windows\System32\ Next, copy "php.ini-recommended" to C:\Windows\ and rename it "php.ini" (in C:\Windows\). | ||
3. Configuring Internet Information Services (IIS) Manager:
If you are using the new style Start menu, you can reach the Internet Information Services console by clicking “Start”, “Administrative Tools” and selecting “Internet Information Services (IIS) Manager” from the list. If you are using the “Classic” style Start Menu, you can reach the console by clicking “Start”, “Programs”, “Administrative Tools” and select “Internet Information Services (IIS) Manager” from the list. The first thing we need to do is tell IIS how it should process PHP files. To do this, first right-click on "Web Sites" in the left-hand menu and select "Properties" from the list that appears (as shown in Figure 2 above).
Once open, select the "Home Directory" tab and click on "Configuration". A similar window to figure 3 (above) will appear. Click on "Add".
Complete the box shown in Figure 4 (above) as shown then press "OK". If you see a message appear with a list of "Child Nodes" you should check them carefully before selecting which should be PHP-enabled. Be particularly careful if you are running Microsoft Exchange Outlook Web Access (OWA) as overriding the OWA Virtual Directory settings will stop it from working! IIS now knows how to process PHP files. However, it's "Web Service Extensions" rules still restrict it from doing this.
We now need to configure "Web Service Extensions" so right-click on "Web Service Extensions" in the menu on the left. Then select "Add a new Web service extension..." from the list (as shown in Figure 5 above)
Complete the dialogue box as shown in Figure 6 above. Make sure you check the "Set extension status to Allowed" checkbox. The "Extension name:" is only a reference and hence can be anything - PHP makes it easy to identify in future though.
The completed "Web Service Extensions" window should now look like figure 7 above.IIS now knows to process PHP files and our "Web Service Extensions" have made it possible for PHP scripts to run freely. | ||
4. Allowing index.php files to run as a directory default:
Returning to "Web Sites Properties" dialogue shown in Figure 2 we need to select the "Documents" tab and click on "Add". To ensure that index.php documents open as a default they should be added as a "Content Page" as shown in Figure 8. You can, of course, change the importance of PHP over ASP and HTML documents to suit your site based on which document type should take preference. | ||
TESTING...
Create a new text file and rename it "index.php". This file should contain one line that reads: <? phpinfo(); ?> |
'Infrastructure' 카테고리의 다른 글
웹 프록시를 이용해 우회를 하자 (0) | 2011.07.23 |
---|---|
Vsftpd backdoor discovered in source code (1) | 2011.07.05 |
Windows2003 IIS6 + PHP-5.3.6-nts-Win32-VC9-x86 (0) | 2011.06.30 |
VisualSVN Trac 세팅 (0) | 2011.06.29 |
VISUALSVN SERVER // Installing Trac with VisualSVN Server (0) | 2011.06.29 |