Apache module to run PHP environment build method Download Apache
Note: Apache is downloaded in http://www.apachelounge.com/because the website provided by Apache is compiled by a later version of the VC compiler. Since the PHP version I downloaded next is VC11, the version of Apache downloaded is also based on VC11.
Download:httpd-2.4.10-win64-vc11
Download PHP
PHP version of how to choose to see "PHP Version Selection", Php:http://windows.php.net/download.
DOWNLOAD:VC11 x64 Thread Safe (2015-jan-22 03:12:55)
Installing Apache
- Extract Apache to C drive
- CMD under Start Apache.
C:\Apache24\bin>httpd
Browser testing
Enter http://localhost/in the browser, if the interface successfully displays "It works!" indicates that Apache started successfully.
Install to the Windows Service so that the system will automatically open Apache later.
C:\Apache24\bin>httpd -k install
Common HTTPD commands
- -K Start: Start Apache
- -K Restart: restarting Apache
- -K Stop: Off Apache
- -K Install: Installing Windows Services
- -K Uninstall: Uninstalling the Windows service
Tips and issues that may arise from the above process
Error:AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using fe80::5825:3995:1bca:8a19. Set the ServerName‘ directive globally to suppress this message
Solve:并不影响正常使用,如需解决,在C:\Apache24\conf\httpd.conf 中搜索 ‘ServerName‘ , 将 ‘#ServerName www.example.com:80‘ 改成 ‘ServerName www.example.com:80’ (去掉前面的#符号)
Install PHP
- Unzip PHP to C drive
- Change the "php.ini-development" file under the directory to "PHP.ini"
- Search "Extension_dir"
; On windows:
; extension_dir = "ext"
改成
; On windows:
extension_dir = "ext"
- Search for the following to open them all (open to remove the previous '; ') No.
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_odbc.dll
extension=php_xmlrpc.dll
Integrate PHP and Apache
At the end of the httpd.conf file under Apache Config, add the following, if your PHP directory is not in the C drive, be careful to modify the path
LoadModule php5_module "C:/php5521/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php .htm
# configure the path to php.ini
PHPIniDir "C:/php5521"
From for notes (Wiz)
PHP Environment Setup