疯马少年
2015-12-16 23:21
全部按照视频来的,怎么会这样?
找到Apache的\conf目录下的httpd.conf文件,打开它,找到下面这两行:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
把它改成下面这样:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
这个你做了没有?
如果做了:那么按照一下方式去配置
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "F:\wamp\www\blog\public"
ServerName laravel.ys7.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
然后,我再稍微问一下,你确定你的www目录没错嘛?是D盘下的DEMO这个目录?
看阿帕奇官方文档啊,权限的问题 将<Directory />
AllowOverride None
Require all denied
</Directory>里面的 两行代码
改为<Directory />
#AllowOverride None
#Require all denied
</Directory>
我的按视频操作也出现这问题,找了半天发现是这里的问题,httpd.conf文件关于DocumentRoot "D:/webdir/"下边的权限需要注释掉,视频只提到了<Directory "D:/webdir/">的权限问题
DocumentRoot "D:/webdir/"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
# AllowOverride none
# Require all denied
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
有什么不对的吗?
php.ini?
1、确定你的端口是80
2、确定你更改了httpd.conf文件开启了虚拟路径(我描述有点问题,你懂就可以)这个选项
2.1 我有点忘了,这个文件php.ini 貌似也是要配置的
3、确定你更改了httpd-vhosts.conf文件设置正确
4、确定你更改了host文件
5、确定你重启了wamp(或者其他)所有的服务
6、确定你重启浏览器(这个其实无所谓,最好重启)
在localhost后面加个80端口号就可以了
PHP入门篇
455995 学习 · 6306 问题
相似问题