Configure the PhP5 runtime environment in Windows 7 iis7

Source: Internet
Author: User
Tags vc9

I always wanted to practice PHP. Recently, I had some time to configure a PHP runtime environment on my machine. I used the Windows 7 platform and recorded this basic step.

Download the latest PHP version:

Http://windows.php.net/download/ I use a php-5.3.2-Win32-VC9-x86

It has two versions: vc6 and vc9. The difference is that the compiler is different. If you want to run it under iis7, download vc9.

After downloading the file, install it directly. After installing it in D: \ Program Files \ PHP, directly modify the php. ini configuration file under this directory.

FastCGI. Impersonate = 1

CGI. fix_pathinfo = 1

CGI. force_redirect = 0

Open_basedirPoint to include PHPProgram. [Optional]

Extension_dir = "./EXT"Note: In previous versions, the absolute path is often used here, but now you can use this method for general configuration. You only need to remove the previous one.

To verify whether PHP is successfully installed, run the D: \ Program Files \ PHP Directory in the console and run php-info. If it is normal, a bunch of configuration information is displayed.

Set iis7

First, make sure that your system has applied CGI. If not, openControl Panel | programs and components | enables or disables Windows, The English version of the corresponding operation isControl Panel | programs and features | turn windows features on or OFF.

View

Then set IIS to parse the PHP script:

Open the IIS manager, select your machine name, select the handler ing function in the function view on the right, and select Add managed handler on the right. In the dialog box, enter: *. PHP: fastcgimodule. Enter the CGI program in the directory where you install PHP in the last box.

D: \ Program Files \ PHP \ php-cgi.exe

Verification: Create a new website and write the test. php file

<? PHP
Phpinfo ();
?>

You can view the file on IIS to view the configuration information.

 

 

      • FastCGI. Impersonate = 1
      • CGI. fix_pathinfo = 1
      • CGI. force_redirect = 0
      • Open_basedirPoint to the path of the website containing the PHP program. [Optional]
      • Extension_dir = "./EXT"Note: In previous versions, the absolute path is often used here, but now you can use this method for general configuration.

    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.