First, download the address
Apache 5.4--httpd-2.4.4-win32.zip
PHP 5.4--php-5.4.15-win32-vc9-x86.zip
Note that the PHP and Apache connector DLLs are already included in the VC9 thread-safe version, so there is no need to download this DLL.
Second, the configuration
1. Apache
Use any editor to open the apache2.4/conf/httpd.conf file to start configuration.
1.1 Set Apache location
Copy Code code as follows:
ServerRoot "D:/program files/apache2.4"
1.2 Enable the use of the module
I only removed the annotation for the Mod_rewrite module.
1.3 Add the following content under the module content
Copy Code code 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 server Administrator email address
Copy Code code as follows:
ServerAdmin info@yoursite.com
1.5 Modifying the document root directory
Copy Code code as follows:
DocumentRoot "E:/www"
<directory "E:/www" >
1.6 Find the content replace the actual path
Copy Code code as follows:
scriptalias/cgi-bin/"D:/program files/apache2.4/cgi-bin/"
<directory "D:/program Files/apache2.4/cgi-bin" >
1.7 If you want to enable. htaccess Please modify <directory "d:/www" > Content
Copy Code code as follows:
1.8 Add index.php to index directory
Copy Code code as follows:
DirectoryIndex index.html index.php
2. PHP
1.1 renaming Php.ini-development to PHP.ini
1.2 Modifying the extended path
Copy Code code as follows:
Extension_dir = "D:/program files/php5.4/ext"
1.3 Uncomment the following line
Copy Code code 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 please modify the following content
Copy Code code as follows:
SMTP = smtp.yoursite.com
Smtp_port = 25
Sendmail_from = youremail@sender.com
1.5 Last set the next time zone
Copy Code code as follows:
Third, installation
The Apache 2.4 service needs to be installed in the system service, start-> run, enter cmd, and then enter by line:
Copy Code code as follows:
CD D:/program Files/apache2.4/bin
Httpd.exe-k install-n "Apache24"
Write a index.php file, the content is <?php phpinfo (), Start Apache service, visit the following http://localhost/bar