一、Apache 安装
1、下载Apache
http://httpd.apache.org/download.cgi
2、安装Apache
# define properties
Define static_path D:/victor.min/software/httpd-2.4.18-win64-VC14/Apache24
# server root
ServerRoot "${static_path}"
# listen port
Listen 80
# server name
ServerName localhost:80
# document root
DocumentRoot "${static_path}/../htdocs"
<Directory "${static_path}/../htdocs">
# php
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
# php7 support
Define php_home D:/victor.min/software/php-7.0.4-Win32-VC14-x64
LoadModule php7_module ${php_home}/php7apache2_4.dll
AddHandler application/x-httpd-php .php
# configure the path go php.ini
PHPIniDir ${php_home}
# install
httpd -k install -n apache
# remove
sc delete apache
<!-- virtual host -->
<VirtualHost 127.0.0.7:80>
DocumentRoot "D:/victor.min/git"
ServerName 127.0.0.7:80
ErrorLog "logs/victor.com-error.log"
CustomLog "logs/victor.com-access.log" common
</VirtualHost>
<Directory "D:/victor.min/git">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
二、PHP 安装
1、下载PHP
http://windows.php.net/download/
2、安装PHP
copy php.ini-development 改为 php.ini
extension_dir = "D:/victor.min/software/php-7.0.4-Win32-VC14-x64/ext"
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
#########################################################
注:如果提示丢失 dll, 先安装 vc_redist.x64.exe
https://www.microsoft.com/en-us/download/details.aspx?id=48145