您的位置:首页 > 产品设计 > UI/UE

localhost访问 报错The requested URL /phpinfo.php was not found on this server

2018-03-21 00:05 549 查看
在phpstudy2016版集成软件中,打开localhost访问文件报404错误。



解决方法
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐