kertz
2016-05-20 01:10
# symbolic links and aliases may be used to point to other locations. # DocumentRoot "D:/test" <Directory "D:/test/"> # # Possible values for the Options directive are "None", "All", # or any combination of:
将httpd.conf 中做如下更改:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
再重启服务
Step1. 自定义网站根目录
1)修改D:\wamp64\bin\apache\apache2.4.23\conf\httpd.conf文件,如将:
DocumentRoot "${INSTALL_DIR}/www" 改为 DocumentRoot "d:/PHPdemo/www"
<Directory "${INSTALL_DIR}/www/"> 改为 <Directory "d:/PHPdemo/www/">
S
2)修改D:\wamp64\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf文件,如将:
DocumentRoot D:/wamp64/www 改为DocumentRoot D:/PHPdemo/www
<Directory "D:/wamp64/www/"> 改为<Directory "D:/PHPdemo/www/">
这个改动很关键,因为httpd.conf文件中,默认定义了:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
所以需要修改httpd-vhosts.conf,否则会出现第1步修改没效果(浏览器打开localhost还是老样子)
Step2. 以下为修改左键点击samp图标‘www根目录’名称和指向
3)修改D:\wamp64\wampmanager.ini文件,修改下Caption和FileName,如:
Type: item; Caption: "demo_www"; Action: shellexecute; FileName: "D:/PHPdemo/www"; Glyph: 2
4)修改D:\wamp64\wampmanager.tpl文件,修改下Caption和FileName,如:
Type: item; Caption: "demo_www"; Action: shellexecute; FileName: "D:/PHPdemo/www"; Glyph: 2
点击localhost还是原来的主页
PHP入门篇
455994 学习 · 6306 问题
相似问题