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.