一、使用宝塔安装环境:
php7.2
iis10.0
mysql5.5
安装完成后,web站点的目录为:D:/wwwroot
二、也可手动安装
1 安装php7.2
2 安装apache服务器
下载安装文件Welcome! - The Apache HTTP Server Project
解压到D:\BtSoft目录,
打开httpd.conf,本机的安装目录为D:\BtSoft\Apache24\conf
修改php.ini:
;TODO changed extension_dir = "ext"
extension_dir = "D:/BtSoft/php/72/ext"
;
;extension=curl
;extension=gd2
;extension=gettext
;extension=mbstring
;extension=mysqli
;extension=pdo_mysql
;extension=pdo_sqlite
;extension=sockets
配置如下:
Define SRVROOT "D:/BtSoft/Apache24" //当前 apache的安装目录
Listen 8889 //修改端口号
添加如下代码:
#TODO set serverName
ServerName localhost:80
# TODO enabled
Include conf/extra/httpd-vhosts.conf
#TODO AddLine
# php7 support
LoadModule php7_module D:/BtSoft/php/php7234/php7apache2_4.dll
AddType application/x-httpd-php .php .html .htm
#configure the path to php.ini
PHPIniDir D:/BtSoft/php/php7234