onestopweb 阅读(163) 评论(0)

安装IIS7,安装Apache2.4,安装PHP7.0

 

IIS7监听指定IP,cmd运行

//添加
netsh http add iplisten ipaddress=192.168.221.128
//查看
netsh http show iplisten
//删除
netsh http delete iplisten ipaddress=192.168.221.128

 

D:\Apache\Apache\conf\httpd.conf 的配置

//38行
Define SRVROOT "D:/Apache/Apache"

#Listen 12.34.56.78:80
//60行
Listen 192.168.221.129:80

//281行
<IfModule dir_module>
	DirectoryIndex index.html index.php
</IfModule>

//最后添加
# php7 support
LoadModule php7_module D:/Apache/php/php7apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "D:/Apache/php"

 

开启Apache服务

D:\Apache\Apache\bin\httpd.exe -k install

 

 c:\windows\system32\drivers\etc\hosts 配置

//最后添加
192.168.221.129       www.tp5.com		#TP5测试
192.168.221.129       www.demo.com		#PHP7测试

 

D:\Apache\Apache\conf\httpd.conf 的配置

//500行
# Virtual hosts
 Include conf/extra/httpd-vhosts.conf

 

D:\Apache\Apache\conf\extra\httpd-vhosts.conf 配置

//最后添加
<VirtualHost _default_:80>
	DocumentRoot "${SRVROOT}/htdocs/tp5"
	ServerName www.tp5.com:80
</VirtualHost>

<VirtualHost _default_:80>
	DocumentRoot "${SRVROOT}/htdocs/demo"
	ServerName www.demo.com:80
</VirtualHost>

 

效果图: