直接在wampserver中修改Apache中的httpd-vhosts.conf文件里的
DocumentRoot "E:/php/Demo"
<Directory "E:/php/Demo">
这两行里的路径。
即将E:/php/Demo修改成你想设置的根目录路径.
如你想设置的根目录路径为"D:\Demo"
则将改成 DocumentRoot "D:\Demo"
<Directory "D:\Demo">
https://jingyan.baidu.com/article/0320e2c130a4371b87507bcf.html