localhost访问 报错The requested URL /phpinfo.php was not found on this server
2018-03-21 00:05
549 查看
在phpstudy2016版集成软件中,打开localhost访问文件报404错误。
![](//img-blog.csdn.net/20180320234814465?watermark/2/text/Ly9ibG9nLmNzZG4ubmV0L3lhbmd4aWFvX3Nh/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
解决方法
1.打开httpd-vhosts.conf文件,配置一个虚拟主机
<VirtualHost *:80>
DocumentRoot "D:\phpStudy\WWW"
ServerName localhost
ServerAlias
<Directory "D:\phpStudy\WWW">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
2. 将httpd.conf文件中的 ServerName localhost 注释掉(个别人中的语句可能会有些许差别)。
![](//img-blog.csdn.net/20180320235743334?watermark/2/text/Ly9ibG9nLmNzZG4ubmV0L3lhbmd4aWFvX3Nh/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
3.打开hosts文件,添加域名
127.0.0.1 localhost
4.重启Apache后,访问文件即可通过。
![](//img-blog.csdn.net/20180321000049373?watermark/2/text/Ly9ibG9nLmNzZG4ubmV0L3lhbmd4aWFvX3Nh/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
文章来源:https://www.cnblogs.com/superfat/p/5228347.html
解决方法
1.打开httpd-vhosts.conf文件,配置一个虚拟主机
<VirtualHost *:80>
DocumentRoot "D:\phpStudy\WWW"
ServerName localhost
ServerAlias
<Directory "D:\phpStudy\WWW">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
2. 将httpd.conf文件中的 ServerName localhost 注释掉(个别人中的语句可能会有些许差别)。
3.打开hosts文件,添加域名
127.0.0.1 localhost
4.重启Apache后,访问文件即可通过。
文章来源:https://www.cnblogs.com/superfat/p/5228347.html
相关文章推荐
- ubuntu14.04 安装LAMP中访问info.php提示The requested URL /index.php was not found on this server.
- 关于wamp下http://localhost地址The requested URL / was not found on this server.问题解决过程分享
- 访问本地环境时出现The requested URL / was not found on this server.
- The requested URL /test.php was not found on this server.
- apache url重写 出现The requested URL was not found on this server的问题index.php路径加上index.php就正常的问题
- Not Found The requested URL /phpMyAdmin/index.php was not found on this server.解决办法
- 访问页面出错:The requested URL / was not found on this server. 网站打开出现404
- php ci 报错 Object not found! The requested URL was not found on this server. If you entered the URL manually please check
- PHP zend framework The requested URL /XXX/public/index was not found on this server
- The requested URL /**** was not found on this server
- The requested URL /xxxx.html was not found on this server
- The requested URL *** was not found on this server
- Zend Framework: The requested URL /newposter was not found on this server.
- The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server
- The requested URL *** was not found on this server
- 404 Not Found The requested URL * was not found on this server
- 【每日学习】Apache重写未开启,导致The requested URL /xxxx.html was not found on this server
- linux中提示The requested URL *** was not found on this server
- 404 Not Found The requested URL * was not found on this server
- 浏览器显示The requested URL *** was not found on this server