How to configure the PHP environment in IIS in windows _ PHP Tutorial

Source: Internet
Author: User
Tags vc9
In windows, how does one configure the PHP environment in IIS. This article introduces several methods for iis7 to configure the php environment in windows. For more information, see PHP5.2.17 and PHP5.3.5, iis7 configuration P this article will introduce several methods for iis7 to configure the php environment in windows. For more information, see PHP5.2.17 and PHP5.3.5, configure PHP5.3.5 and PHP5.2.17 in iis7.

Download from the official website

PHP5.2.17 official download: http://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.zip
PHP5.3.5 official download: http://windows.php.net/downloads/releases/php-5.3.5-Win32-VC9-x86.zip

Note that it must be a thread-safe version. if it is not used by anyone in the beta version of server guard, a security version should be made on the server.

In php. the INI file configuration is the php file that we can use if it is a development version. ini file. if it is a product or server version, we need to use php. ini-production, but in php5.2.17, the application file is php. ini-recommended.

Php. ini-production corresponds to php. ini-recommended
Php. ini-development corresponds to php. ini-dist

All the precautions are covered. let's take a look at the graphic tutorial below.

First, install IIS7 and check the three items.

Note: CGI will be used in IIS7 + PHP_5.3.5 environment

ISAPI extension and ISAPI filter used in IIS7 + PHP_5.2.17

Add PHP support for IIS below

IIS7 + PHP_5.3.5

1. decompress the downloaded php_5.3.5 to the C: php Directory (you can also put it elsewhere, but modify it later)

2. rename php. ini-development to php. ini.

3. modify php. search for data in ini. change timezone to date. timezone = "Asia/Shanghai" (this must be changed here, otherwise a warning will be reported) find Windows Extensions to enable the required modules, such as php_curl.dll php_mysql.dll php_mysqli.dll php_xmlrpc.dll php_curl.dll. you just

4. add <模块映射>

The path here is based on your actual situation.

5. inWebsiteCreate a new phpinfo. php text file in the root directory:

Phpinfo ();
?>

6. test. open the browser and check the result: localhost/phpinfo. php. if you can see a page similar to the following, it means you have succeeded:

Now we can successfully run the PHP program.

IIS7 + PHP_5.2.17

The isapi extension and isapi filtering have been selected before IIS is installed. you do not need to add a role service here.

Modify the php. ini file first ..

Put php under c: php. ini-dist (the display extension must be set first) and renamed to php. ini, open it in Notepad and find extension_dir = ". /", and then put. /change to c: php (modify the path based on your actual situation)

1. add an application pool

2. add isapi and cgi restrictions

3. add an isapi filter

4. add script ing

5. test (phpinfo. php has been created before). open localhost/phpinfo. php as before to check the effect:

The following describes how to configure apache + php.

1. I personally think that the first thing to pay attention to when configuring PHP in Apache is the version information of Apache and PHP. the parameters to be set for different versions are different, and the beginning of the process is blind, so I have suffered a lot.
2. select Apache 2.2.14 PHP: 5.2.5...
3. verify that Apache and PHP are successfully installed:
(1) Apache: http: // localhost
(2) PHP: run php-I in the dos window
4. PHP configuration file php. ini
(1) modify:

The code is as follows:
Extension_dir = "./"
Extension_dir = "C:/Program Files/PHP/ext" (path of the ext subdirectory in the actual directory where PHP is installed)

(2) uncomment to support mysql databases

The code is as follows:
Extension = php_mysql.dll
Extension = php_mysqli.dll

(3) environment variables:

The code is as follows:
PHPRC: C: Program FilesPHP
Add: C: Program FilesPHP in Path

Copy the liblibmysql. dll file to C: WINDOWSsystem32.
(Httpd.exe error may be reported if this step is not performed)
5. Apache configuration file httpd. conf
(1) add support for php

The code is as follows:
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
PHPIniDir "C:/Program Files/PHP"

(2) actual working directory:

The code is as follows:
DocumentRoot "F:/ApcheWork"


Options FollowSymLinks
AllowOverride None
Order deny, allow
Allow from all

(3) add support for index. php

The code is as follows:

DirectoryIndex index. php index.html

(4) supported adding types

The code is as follows:

AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
AddType application/x-httpd-php. php. phtml. php3. php4
AddType application/x-httpd-php-source. phps


Friendly reminder: Based on our experience, if you are iis7, you will use PHP5.3.5 vc9 for compiling. if you are apache2.2, you will use php2.1.7 to use vc6 for compiling. for details about this, please download it from the official website,

For iis7, configure P...

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.