This article describes how to install Apache2.4 and PHP5.4 in Window7XP. For more information, see Apache
I,
Apache 5.4 -- httpd-2.4.4-win32.zip
PHP 5.4 -- php-5.4.15-Win32-VC9-x86.zip
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:
ServerAdmin info@yoursite.com
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 = smtp.yoursite.com
Smtp_port = 25
Sendmail_from = youremail@sender.com
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/