How to configure IIS7 asp and php mysql in win 2008

Source: Internet
Author: User
Tags mysql in php mysql php tutorial php website zend

Iis7 and iis7.5 are not installed by default in windows. Therefore, if you need to install iis7/iis7.5 after installing windows vista/windows 7/windows 2008, you have to do it yourself.

The installation procedure is: start control panel program to enable or disable windows function internet information service. When installing iis7, you must note that if you need support for asp and asp.net tutorials, you need to install the function module. By default, it is not installed.

 

After iis7 is installed, you can see "administrative tools" in all programs in the Start menu, which has an "internet information service manager". If not, follow these steps: start> right-click Properties> Start menu tab> custom. Set "system management tools" to "display in all program menus" or "on all program menus and start menus". show ".

Open the internet information service manager and you will be able to see the iis7 homepage.

Iis7 configure the asp + access environment

After iis7 is installed by default, the asp program will prompt that the connection to the database tutorial fails, because the msjet engine has changed the location of the temporary directory, but does not have temporary access permissions, resulting in database usage failure.

You must set the application pool to classic. netapppool instead of the default defaultapppool. You can set each site in the website directory or separately at the site. After selecting the site to be set, click "basic settings" on the right to bring up the application pool settings dialog box.

Then, add an "authenticatedusers" user to the "system disk: windowsserviceprofilesnetworkserviceappdatalocaltemp" directory. The appdata directory is hidden and you can enter a path directly in the address bar, or hide the file in the folder option.


To set permissions, right-click the temp folder, select Properties, select security tab, click edit, and then click add ", in the following "enter object name to select", enter authenticatedusers, OK, and return to "temp permission". The authenticated users permission is fully controlled and checked.

Enable parent path support

Select "asp" on the site homepage, and set "enable parent path" to "true" in the "behavior" group.

Right-click the website folder, select "properties", select the "security" tab, click "edit", and click "add ", in the following "enter object name to select", enter everyone, OK, and return to "folder permissions". In this case, the permissions of everyone are fully controlled, and OK. [Note: For convenience, please consult relevant professionals for detailed security configuration]


The following describes how to configure the php Tutorial environment in iis 7.0.

My configuration environment is windows 7x64 + iis 7.5, but the content in this article should be completely common in windows 7.x, because fastcgi has become a built-in component since iis 7.0. For earlier versions, fastcgi support needs to be installed, and the configuration is slightly different.

Part I. Enable fastcgi support in iis 7.x

Open control panel in turn | program and component | enable or disable windows. The corresponding operation in English version is control panel | programs and features | turn windows features on or off. enable fastcgi as shown in the figure below (check cgi to enable both cgi and fastcgi support ). You should select other items based on your needs. I checked the items to highlight them.

 

If it is iis7.0, Microsoft has released a series of upgrade patches to fix some of the known issues of the built-in fastcgi module. You can download the corresponding patches based on your system:

Update for windows server 2008
Update for windows server 2008x64 edition
Update for windows server 2008 for itanium-based systems
Update for windows vista sp1
Update for windows vista sp1 for x64 based systems
Part ii. Install and configure php

In Microsoft's official article, we recommend that you use the non-secure thread version of php (non-thread safe build of php). However, zend optimizer in this version is complicated to enable, most commercial php programs are inseparable from zend optimizer, so we recommend that you still use the secure thread version of php. Download the latest php zip package from the official php website. This article uses php 5.2.9-2. Download address: php 5.2.9-2 zip package.

After the download, decompress the package to any Directory (in this article, d: serverphp is used, and all the places that involve this path are represented as [php install dir]), and then the php. ini-recommend is renamed to php. ini. Open the file in any text editor and check the following settings:

Fastcgi. impersonate = 1
Cgi. fix_pathinfo = 1
Cgi. force_redirect = 0
Open_basedir points to the website path containing the php program. [Optional]
Extension_dir = "./ext"; note: in previous versions, absolute paths are often used, but general configurations can be used now.
Delete The Semicolon before the php extension add-on that you want to activate, for example:
Extension = php_mssql.dll
Extension = php_mysql tutorial. dll
Note: not all projects can be activated. It is best to activate only the items you need. If one item cannot run after activation, comment out the item and restart iis.
After the settings are complete, you can start a command prompt window (cmd.exe) and run [php install dir]/php-info to check whether php can run correctly. If yes, a series of environment variable prompts will be output.

Part iii. Configure iis to process php requests

Open the iis Manager, select your computer on the left, and click "handler mapping" in the middle window, i'm not sure what the project will translate in the Chinese version of the operating system), and then click "add module mapping…" on the right ..." (Add module ing ).

In the add module mapping dialog box that appears, enter your own installation path ([php install dir]/php-cgi.exe) as shown in the following figure (executable (optional ):

 

Click OK. A confirmation dialog box is displayed, asking if you want to add the module ING. Click yes to continue.

 

This completes the installation of php in iis 7.x. Create a text file under your website directory with the file name suffix. php, such as test. php, the file contains only one line:

<? Php phpinfo ();?>

Then browse the file in the browser (usually http: // localhost/test. php). Normally, the default information page of php is displayed.

 

According to different configurations, the information may be different. I have installed zend optimizer v3.3.3 in the screenshot here. By default, zend optimizer v3.3.3 does not exist. You can download and install it on your own, the installation of zend optimizer is the same as that of all previous versions. Even if there is no tutorial, you can install zend optimizer by following the installation wizard step by step. I will not go into details here. In addition, the installation of mysql and phpmyadmin is the same. It is not related to the iis version. No More

Notes for configuration

Some of its configuration methods and precautions:

1: install iis7.0: go to the control panel of vista or 2008, select open or close windows function on the left side, and the option menu to install windows function appears, because the default installation options of iis7 in vista do not support asp and asp.net, you must manually select the required features during installation.

2: Open iis7.0: After the installation is complete, go to the control panel again and select the management tool-"internet information service iis Manager"

3: Set iis7.0: Select default web site and double-click the asp parent path in the asp option iis7. To use asp conveniently, select true to enable the parent path, this step completes the parent path options.

4: iis7 site settings: Right-click the default web site option and select the advanced settings option marked by the red line. Set the home directory and access port of the website. According to the above steps, iis7 has been basically completed. However, in windows vista, you can only debug asp programs, but you still cannot debug asp access programs, this is because of the directory permissions of windows vista. The last step is to set the directory permissions.

5. Permission settings:
A: find the system installation disk: windowsserviceprofilesnetworkserviceappdatalocal. It is best to manually enter the path because the appdata file is hidden. Right-click the temp folder and select Properties.
B: select security options and click edit to go to the edit permission dialog box.
C: Select add to add a user.
D: in the select user or group dialog box, enter uppercase Subtitle a in the input object name selection form, and click OK, the system automatically displays all system users with Letters.
E: Select the user athenticated users from the user list, and click OK.
F: After the user is added, select the user to be added, click "full control", and click "OK". In this way, the access permission of temp is settled. The system will have a security prompt. Select OK.

Try to see if asp access can be run. This is done.

Note: Note that because vista is in ntfs (disk format), you must add full control permissions for iuser _ machine name and athenticated users in the security label of your folder. Why does iwam disappear? Don't understand.

 

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.