Novice Learning: Let IIS support the configuration method of PHP

Source: Internet
Author: User
Tags filter install php iis net php file php debug php programming root directory
Iis

How is this impossible? In fact, a large number of DZ Forums online is the adoption of Php+iis, the following is the process of configuring IIS to support PHP:

1. Install PHP as ISAPI mode:

In Control Panel, in Administrative Tools, select Internet Services Manager. Stop the service after you turn on IIS, and then right-click the default Web site on the left and select Properties, locate and click Add in the ISAPI Filter tab of the Default Web site Properties window that opens button, enter PHP in the Filter Name field in the Pop-up Filter Properties window, and then point the executable file to the path where Php4isapi.dll is located, such as: C:\PHP\sapi\php4isapi.dll.

2, open the Home Directory tab of the default Web Site Properties window, locate and click the "Configure" button, locate and click the "Add" button in the pop-up Application Configuration window, add an extension map to the pop-up window, and click Browse to point the executable file to Php4isapi.dll path, such as: C:\PHP\sapi\php4isapi.dll, and then all the way OK. If you also want to support PHP files such as. php3,.phtml extensions, you can repeat the "add" step.

3, then open the "Default Web Site Properties" window of the "Document" tab, find and click the "Add" button, to the default Web site launch document list to add index.php items. You can raise the index.php to the highest priority so that the index.php document is automatically searched and opened first when you visit the site.

4. Determine the application settings and execution permissions for the Web directory to select as pure script, and then close Internet Information Services Manager, and execute the following command at the command prompt:

net stop w3svc

net stop IISAdmin

net start w3svc

5, open the browser, enter: http://localhost/, see the success of the page, in the IIS root directory under the new phpinfo.php, the contents are as follows:

   <?php phpinfo ();? >

6, open the browser, input: http://localhost/phpinfo.php, will display the current server support PHP all the information, you can see the Server API mode: ISAPI.

I am learning this aspect of things, just see this article configuration, and learn some things, send up and share with you.

The Internet Information Services (IIS) built into Windows systems have good support for ASPs, so it is convenient to debug ASP Web pages in IIS. But some friends of the Web page using the PHP programming technology, by default, IIS is not support PHP, manual configuration of IIS debugging Environment for our rookie is very difficult, how can we let IIS support PHP? Here's a way to do this. You can configure the PHP debugging environment in IIS in a few simple steps.

  Installing the IIS Components

The author takes the IIS5.1 of Windows XP system as an example, first must install the IIS component, the system is installed by default. If you don't have it in your system, go to control Panel → add or Remove Programs → add/Remove Windows components, select the Internet Information Services (IIS) option in the Windows Components Wizard dialog box (Figure 1), and click Next button to complete the installation of the IIS component.

  

Figure 1 Installing the IIS Component

  Configuring the PHP Debugging Environment

Can search the internet to download the PHP installer to the local machine, below we use the PHP Installation Wizard to complete the configuration of the PHP debugging environment.

  

Figure 2 Selecting a Web server

To run the installer for the PHP package, click the "Next" button in the pop-up Welcome window, click the "I Agree" button in the License Agreement window, and then select "Standard (Standard)" Installation in the Installation Type window, and click "Installation" Next button, specify the installation directory for PHP, and we recommend that you use the default installation directory. Next, set the mail address in the Mail Configuration window and specify the SMTP server, select the type of Web server you use in the service type (server type) window (Figure 2) because we use Windows XP system with the IIS5.1, select the "Microsoft IIS4 or higher" single option, click "Next" after the installation, and finally in the "IIS scriptmap Node Selection" window Select all the sites (see Figure 3), click the "OK" button , you complete the installation and configuration of PHP.

  

Figure 3 Selecting All Sites

  Check the PHP Debug environment configuration

Go to Control Panel → admin tool, run the Internet Information Service program, right-click the "Default Web Site" In the pop-up menu select "Properties", and then in the pop-up Properties dialog box to switch to the "Home Directory" tab, click on the application settings bar "Configuration" button, pop-up "application Configuration" dialog box, in the Mappings tab page, to see if an option with the extension ". ph P" is available in the Application Mapping list box (Figure 4), which means that the PHP installation configuration was successful.

  

Figure 4 View Program Mappings

If you do not find this option, you can also add it manually. Click the Add button in the Application Configuration dialog box, pop the Add/Edit Application Extension Mapping dialog box (Figure 5), enter the "Php.exe" program path in the "Executable" field, and enter in "extension". PHP, the other options use the default settings, and finally click the "OK" button.

  

Figure 5 Adding mappings manually

This completes the configuration of the PHP debugging environment and can then debug the php file in IIS.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.