How to install PHP in IIS

Source: Internet
Author: User

After learning about the two most common servers, let's take a look at how to install PHP in IIS. When running PHP, we need a WEB server to support its operation. Next, let's start our journey of installing PHP in IIS!

Install PHP in IIS:

1. decompress the downloaded PHP installation package in IIS to the root directory of your C drive (the C root directory disk is selected here for future convenience of modification and debugging, you can also choose a different directory), decompress it, you should be able to get a directory similar to "php-4.2.3-Win32", change the directory name to "PHP ".

2. open the decompressed PHP Directory and you will find a directory named "php. ini-dist file. This is the PHP configuration file. You need to rename it to "php. ini ", and then copy it to the system directory (If your system is attached to drive C, it is" C: \ windows "under XP, and" C: \ winnt "under Windows2000 ").

In the past, many articles about php files installed in IIS mentioned that php should be modified. in ini, the values of "extension_dir" and "doc_root" have not been changed and no errors have been made during iis php installation. It seems that these two parameters are not required. Of course, you can modify it if you are not at ease.

Change doc_root to the root directory of your server, and change extension_dir to the absolute path of the extensions folder in your PHP installation folder.

3. When installing PHP in IIS, open your IIS information service console, right-click the "default website" icon, select Properties, open the default website attribute selection, and then select the "main directory" tab

Click the "Configure" button, and you will see a new tab, which is a defined document type. Click "add" to add "% s" to the absolute path of your php.exe In the executable file box of the dialog box, where "c: \ php \ php.exe % s ", in the extension text box, write the suffix you want the php program to process. Here we write ". php ", the following options can be set by default.

4. All right. Now, try to save the following code into a PHP file with the suffix, and put it in your virtual directory for access to see if the result is normal. Install PHP in IIS. Check whether it can be used normally?

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.