How to configure IIS7.0 to run PHP under Vista

  

First, the environment needs and preparations:

Here we chose the PHP5.2 version, and IIS is the IIS 7.0 that comes with the Vista system.

First of all, we have to install the IIS component. By default, it is not installed on the Vista system.

Step 1: Complete the installation of the IIS component through the Add/Remove Windows component of the Control Panel.

Note: Vista Home Basic does not support IIS, so you must select this version to install.

Step 2: In the Add/Remove Windows Components Options window, we double-click Internet Information Services (IIS), and then select the Internet Information Service Management Unit, Public Files, and Web Services. (Figure 1)


Figure 1

Step 3: Insert the Vista system CD and copy the necessary files to the local hard disk. After the installation, we can use the management tool. <quo;internet information service”Start IIS program. (Figure 2)

Note: If the Ghost version is already integrated, just click on the above picture to confirm the installation, you can install it without having to install it from the CD.


Figure 2

Step 4: IIS7 installation is complete, but ASP does not work properly, you need to configure the following for Vista

1. Open the Vista system support for the parent directory Select "ASP" on the IIS7 management home page of the IIS7 site, and then set the "Enable parent path" to True in the "behavior" group. If you need to turn on debugging, you need to enable "Server-side debugging" in the "Debug properties", "Enable client debugging" and change to True

2. Install the directory C to Vista: \\windows\\ServiceProfiles\\NetworkService\\AppData\\Local\\Temp directory to add a read/write or full control permission for "Autheticated Users".

Especially in the operation of Asp+Access, if you do not operate the Vista system step 2, the following error will occur: Microsoft JET Database Engine error '80004005' Unspecified error.

Second, install the PHP program and settings:

After installing IIS, we can publish the corresponding website, but at this time we can not browse the page created by the PHP language, we need to install PHP first. And set the required parameters.

Step 1: Download the PHP main program, I use PHP 5.2, extract to the local disk C drive root directory. (Figure 3) Attached: PHP5.2.8 download address http://www.php.net/downloads.php#v5


Figure 3

Step 2 Next, copy the php.ini-dist in the PHP folder to the C:\\WINDOWS directory and rename it to php.ini. Copy the two files php5ts.dll and libmysql.dll to C:\\WINDOWS\\system32. (Figure 4)


Figure 4.

Step 3: In order for PHP to support MYSQL and GD libraries, you need to edit the php.ini file and open it with Notepad. File, find “extension_dir”, then modify extension_dir = "./" to extension_dir = "C:\\php\\ext"; Also need to remove the semicolon before “;extension=php_mysql.dll” , changed to extension=php_mysql.dll. Remove the semicolon before “;extension=php_gd2.dll” and change it to extension=php_gd2.dll.

At this point, our PHP installation is complete, but since IIS does not support PHP by default, it can only support ASP. So we also need to create a PHP mapping like CGI.

Third, configure IIS PHP mapping:

Under normal circumstances, the mapping relationship of a language or executive program is solved by ISAPI filter, PHP is no exception.

Step 1: Open IIS and click on the top default website - home page. (Figure 5)


Figure 5

Step 2: Click on the ISAPI and CGI restrictions, in the ISAPI or CGI path, find the c:\\php\\ The php5isapi.dll file, which describes writing PHP, enables the execution of extended paths. Figure 6


Figure 6.

Step 3: Click on the handler mapping in IIS, as shown in Figure 7.


Figure 7

Step 4: Return to the IIS home page, click on the MIME type, add the MIME type, fill in the .php file extension, and fill in the MIME type. On text/html, as shown in Figure 8.


Figure 8

Step 5: Click on “Edit Script Mapping” in the right action bar and find c:\\php\\php5isapi.dll by browsing the button. File, extension input *.php (note that there is an * in front), name php, so that php5isapi.dll will be called automatically during the parsing process to interpret the PHP language. (Figure 9 and Figure 10)


Figure 9


Figure 10

Step 6: Go to the default website The "Home", "Default Document", in the Properties window, adds index.php to the default document list. (Figure 11 and Figure 12)


Figure 11


Figure 12

Step 7: Create a new TXT Text file, the content is as follows. Save it as an index.php file and copy it to the website test distribution directory. (Figure 13 and Figure 14)

<? echo phpinfo(); ?>


Figure 13


Figure 14

Step 8: IIS click to browse or enter localhost in the browser to see the PHP version information, which shows that our PHP environment has been built successfully. (Figure 15)


Figure 15

Tip: If index.php doesn't display properly, then we will go to the ISAPI filter in the IIS homepage and add a A filter named PHP, the executable file can be selected c:\\php\\php5isapi.dll, which can often solve the actual problem. (Figure 16)


Ok, everyone is relieved, get it!



Copyright © Windows knowledge All Rights Reserved