Build PHP + Apache in win7

Source: Internet
Author: User
Some time ago, when I was doing automation, I wanted to build a web platform to put common things, including interface Data Query and automatic start and display together, then a simple web environment based on phpapache is built on mac. This is basically what it looks like .. (A little ugly) Later, I wanted to share the same environment on windows

Some time ago, when I was doing automation, I wanted to build a web platform to put common things, including interface Data Query and automatic start and display together, then a simple web environment based on phpapache is built on mac. This is basically what it looks like .. (A little ugly) Later, I wanted to share the same environment on windows

Some time ago, when I was doing automation, I wanted to build a web platform to put common things, including interface Data Query and automatic start and display together, then a simple web environment based on php + apache is built on mac.

This is basically what it looks like .. (Ugly)


Later, in my own house, I wanted to have the same environment on windows. I found that it was not that convenient. I had to wait for more than half of the time (ps: mac is definitely a good thing ), the following are the main steps.

Environment: win7 32-bit

1. php version: 5.5.11 (php-5.5.11-win32-vc11-x86.zip) This version of ts

Address: http://windows.php.net/download/

Php is divided into Thread Safe and Non-Thread Safe, ts and

Official Note: With Apache you have to use the Thread Safe (TS) versions of PHP

There are two differences:

Non Thread Safe Non-Thread security and IIS Environment
Thread Safe Thread security and apache Environment

Thread Safe: the thread security check is performed during execution to prevent the CGI execution method of the new Thread from consuming system resources when new requirements exist.


2. apche version: 2.4 (httpd-2.4.9-win32-VC11.zip)

Address: http://www.apachelounge.com/download/

It is not recommended to download from apache.org


3. install and configure apache

Decompress the package.

Apachemonitor.exe under the Apache24 \ bin directory, which can be used to manage the startup and stop of the apache service

The httpd. conf file in the \ Apache24 \ conf directory is the main configuration file, and the related configurations are completed in this file.

The \ Apache24 \ htdocs directory is the file directory of the website, where all the files of the website are stored.


Configure apache to support php5:

1) after a piece of code related to # LoadModule xxxxxx, add the following content:

LoadModule php5_module D:/PHP/php5apache2_4.dll

PHPIniDir "D:/PHP"


If there are other path problems, you may need to modify the following content:

DocumentRoot "D:/Apache/Apache24/htdocs"

2) Add a new row (if not) ServerRoot "D:/Apache/Apache24"

3) modify the apache index page (add php ):

DirectoryIndex index.html index. php


4. install and configure php5

Decompress the package and change php. ini-recommended to php. ini.

1) Modify:

; Directory in which the loadable extensions (modules) reside.

Http://php.net/extension-dir

; Extension_dir = "./"

; On windows:

Extension_dir = "D:/PHP/ext"

5. Test method: After the apache service is enabled, access localhost










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.