关于Apache配置及phpinfo.php、index.php、phpmyadmin的链接问题

问题1、重启Apache时,出现了

AH00112:Warning:DocumentRoot [D:/AppServ/Apache24/htdcs] does not exist

没有太在意,毕竟在地址栏中输入mylaravel时,还可以出现laravel 5的页面。后来在运行数据库时,出现问题。

问题2、数据库问题,地址输入

localhost/phpmyadmin

在网页上面爆出

The requested URL /phpMyAdmin/ was not found on this server.

问题3、尝试联系AppServ文件夹下的phpinfo.php和index.php两个文件
输入:

localhost/phpinfo.php
localhost/index.php

结果还是爆出:

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

当时运行laravel框架时就完全没压力,直接输出结果。

在网上找啦半天,没有发现可用的信息,就想起配置了httpd-vhost.conf文件。打开该文件看。有一段开启的代码:

<VirtualHost _default_:80>
DocumentRoot "${SRVROOT}/htdocs"
#ServerName www.example.com:80
</VirtualHost>

解决问题1
在Apache目录下创建htdocs文件,尝试了一下重启Apache,没有出现报错。可以!解决问题。

解决问题2
查看C:WindowsSystem32driversetc文件,在文件内容中没有发现

127.0.0.1       localhost

被注解掉。那问题应该出现在httpd-vhost.conf文件中,通过路径和服务器名配置,实现了laravel正常运行,但是localhost不能正常运行。
于是复制一段源码:

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
#    ServerName dummy-host2.example.com
#    ErrorLog "logs/dummy-host2.example.com-error.log"
#    CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost>

修改成:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/AppServ/www"
    ServerName localhost
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

并将:

<VirtualHost _default_:80>
DocumentRoot "${SRVROOT}/htdocs"
#ServerName www.example.com:80
</VirtualHost>

这段代码注解掉

#<VirtualHost _default_:80>
#DocumentRoot "${SRVROOT}/htdocs"
#ServerName www.example.com:80
#</VirtualHost>

最后重启Apache,上述三个问题都解决了。其实我想注解掉了最后一段代码,htdocs文件不添加应该也能解决问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值