How to install Apache2.4 and PHP5.4 on Windows 7/XP

Source: Internet
Author: User
Tags vc9
This article describes how to install Apache2.4 and PHP5.4 in Window7XP. For more information, see Apache

Apache 5.4 --
PHP 5.4 --
Note that the thread security version of VC9 already contains PHP and Apache connector DLL, so you do not need to download this DLL.
II. configuration
1. Apache
Use any editor to open the apache2.4/conf/httpd. conf file to start configuration.
1.1 set Apache location
The code is as follows:
ServerRoot "D:/Program Files/apache2.4"

1.2 enable modules
I only removed the comments from the mod_rewrite module.
1.3 add the following content under the module content
The code is as follows:
LoadModule php5_module "D:/Program Files/PHP5.4, php5apache2_4.dll"
AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
AddHandler application/x-httpd-php. php
PHPIniDir "D:/Program Files/PHP5.4"

1.4 modify the server administrator email address
The code is as follows:

1.5 modify the document root directory
The code is as follows:
DocumentRoot "E:/www"

1.6 find the path to replace the content
The code is as follows:
ScriptAlias/cgi-bin/"D:/Program Files/apache2.4/cgi-bin /"

1.7 if you want to enable. htaccess, modify Content
The code is as follows:
AllowOverride All

1.8 Add index. php to the index Directory
The code is as follows:
DirectoryIndex index.html index. php

2. PHP
1.1 Rename php. ini-development to php. ini.
1.2 modify extension path
The code is as follows:
Extension_dir = "D:/Program Files/PHP5.4/ext"

1.3 cancel comments of the following rows
The code is as follows:
Extension = php_curl.dll
Extension = php_mysql.dll
Extension = php_mysqli.dll
Extension = php_pdo_mysql.dll
Extension = php_soap.dll

1.4 if you use the PHP mail function, modify the following content:
The code is as follows:
Smtp_port = 25
Sendmail_from =

1.5 Last set the time zone
The code is as follows:
Date. timezone = PRC

III. Installation
Install the Apache 2.4 service to the system service, Start-> run, enter cmd, and then enter the following line:
The code is as follows:
Cd D:/Program Files/apache2.4/bin
Httpd.exe-k install-n "Apache24"

Compile an index. php file with the following content: Start the apache service and access the following http: // 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: 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.