The requested URL /test.php was not found on this server.


WampServer自定义网站根目录


D盘新建了Demo文件夹(设定的网站根目录),新建文本test.php,拓展名改为.php

The requested URL /test.php was not found on this server._第1张图片

输入以下内容,如果成功,则输出success。


浏览器中输入要访问的地址:localhost/test.php,出现以下结果:

Not Found

The requested URL /test.php was not found on this server.


Apache/2.4.23 (Win64) PHP/5.6.25 Server at localhost Port 80

The requested URL /test.php was not found on this server._第2张图片

需要配置一下apache里面的配置文件:

httpd.conf   和  httpd.vhosts.conf


The requested URL /test.php was not found on this server._第3张图片


打开后,搜索DocumentRoot更改路径

${INSTALL_DIR}/www/  和  c:/wamp64/www/  改为d:/Demo(设定的网站根目录)

The requested URL /test.php was not found on this server._第4张图片

The requested URL /test.php was not found on this server._第5张图片

重新启动所有服务,就能够访问了

The requested URL /test.php was not found on this server._第6张图片

The requested URL /test.php was not found on this server._第7张图片


同时,要更改安装包下面的wampmanager.iniwampmanager.tpl配置。

The requested URL /test.php was not found on this server._第8张图片


搜索Menu.left,

1、wampmanager.ini下把www 目录对应的filename改为自定义目录

The requested URL /test.php was not found on this server._第9张图片

2、wampmanager.tpl下把${w_wwwDirectory}对应的filename改为自定义目录

The requested URL /test.php was not found on this server._第10张图片


退出、重启服务器,www目录变成了Demo目录,不过是乱码

The requested URL /test.php was not found on this server._第11张图片

点开后就转到了D盘的Demo文件夹
The requested URL /test.php was not found on this server._第12张图片




你可能感兴趣的:(PHP)