wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b搭建php环境
在win下,下载wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe,默认安装。
然后打开安装目录下apache的httpd.conf配置文件D:wampinapacheapache2.4.9confhttpd.conf
修改如下:
1 Listen 0.0.0.0:8088 2 Listen [::0]:8088 3 4 ServerName localhost:8088 5 6 DocumentRoot "D:/kkkoffice/wwwroot" 7 8 <Directory /> 9 #AllowOverride none 10 #Require all denied 11 Options FollowSymLinks 12 AllowOverride None 13 Order deny,allow 14 #Deny from all 15 allow from all 16 </Directory> 17 18 <Directory "D:/wamp/www/"> 19 Options FollowSymLinks 20 AllowOverride None 21 Order deny,allow 22 allow from all 23 </Directory>
说明:
Listen 监听端口
ServerName 服务器名字(带有端口号)
DocumentRoot php文件路径(注意:最后面一定不要带"/")
可能出现的问题:访问 http://localhost:8088/phpinfo.php
如果出现You don't have permission to access /test/file.php on this server
注释Deny from all ----拒绝所有想访问
添加allow from all
每次修改完apache的httpd.conf都记得要重启apache
重启刷新页面正常访问如下
好啦,环境已经搭建成功!