The purpose of this article is to tell you how to configure PHP4 into your IIS5 under Win2000 Professional. I use Windows2000 Professional English version, IIS5 English version and PHP4.0.4-Win32 Binaries, which can be downloaded from PHP's official site www.php.net. Be careful not to download the wrong one. The PHP4.0.4 Release Candidate 1 Source is prepared for Unix users. What you need is the PHP 4.0.4 Release Candidate1 Binaries for Win32.
Note that you need to install IIS5 first, because Win2000 Professional forgets it during the default installation. There is no need to discuss the installation method of IIS5 here. If you have any questions, please refer to other information.
OK!
The first step is to unzip the PHP4.0.4-Win32.ZIP compressed package. You can put it under C:PHP4.
The second step is to copy the php.ini-dist file under C:PHP4 to the WINNT directory and rename it to php.ini. You don't need to modify any parameters to run it. Of course, you can modify some parameters according to different situations.
The third step is to copy C:PHP4php4ts.dll to the C:WINNTsystem32 directory.
Step four, click start->programs->adminstrative tools->internet service manager
Step five, expand "Services and Applications"/"Internet Information Services" on the computer management window. Right-click on the "Default Web Site" and select Properties. The system will pop up the "Default Web Site Properties" window
Step 6: Click on the "ISAPI Filter" label on the "Default Web Site Properties" window. Click the "Add" button, enter "PHP" in the "Filter Name" in the pop-up "Filter Properties" window, enter "C:PHP4sapiphp4isapi.dll" in the "Executable File", and confirm.
Step 7: Click the "Home Directory" tab in the "Default Web Site Properties" window, click the "Configure" button, click the "Add" button in the pop-up "Application Configuration" window, and click the "Add" button in the pop-up "Application Configuration" window. In the "Add/Edit Application Extension Image" dialog box, enter "C:PHP4sapiphp4isapi.dll" in the "Executable File" text box, and enter ".php" in the "Extension" text box (note that there must be that dot ),Sure.
Step 8: Return to the command line window and enter the "net stop iisadmin" command to terminate the IIS service. The system will ask you if you want to stop related services, answer yes.
Restart the IIS service.
OK, your configuration is now over. Let’s write a PHP program to test whether the configuration is successful! Edit a file named hello.php with the content:
echo "Hello, World!";
?>
Save this file in the default Web node file directory (C:Inetpubwwwroot), then open the browser and enter localhost/hello.php in the address bar. If everything goes well, the classic "Hello, World!" should appear in your browser. If the page cannot be found and you can confirm that the above steps are OK, then try entering the address 127.0.0.1/hello.php in the address bar of the browser. If it succeeds, it means there is a problem with your hosts file. , please edit the hosts file under C:WINNTsystem32driversetc and add the line "127.0.0.1 localhost".
Okay, let’s start your PHP journey!