问题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文件不添加应该也能解决问题。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。