【发布时间】:2016-10-09 12:15:04
【问题描述】:
我知道这已被问过 10k 次,但其他地方的解决方案似乎对我不起作用。
我正在使用 apache 2.4.2 运行 WAMP 2.2,并尝试将 DocumentRoot 设置为与默认文件夹不同的文件夹
http://localhost/phpmyadmin/ 工作正常,但我无法加载 localhost 并继续获取:
如果我尝试localhost:8080,我会得到:
httpd.conf
ServerName localhost
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all denied
</Directory>
....
DocumentRoot "C:/Users/wesley.smith/Google Drive/"
<Directory "C:/Users/wesley.smith/Google Drive/">
Options Indexes FollowSymLinks
AllowOverride All
# onlineoffline tag - do not remove
Require all granted
</Directory>
在我的主机文件中,我取消了以下注释:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
我安装了使用端口 80 的 Skype,所以我去了Tools -> Options -> Advanced -> Connections 并取消选中“使用端口 80 和 443 作为替代”框。然后我关闭了Skype,只是为了更好的衡量
如果我运行Apache-> Service-> test port 80,我会得到:
我已经尝试了我在网上找到的所有方法都没有成功,还有什么问题吗?
【问题讨论】:
-
你在关闭Skype后重启电脑了吗?
-
@atefth 我没有重新启动我的电脑,但确实重新启动了 WAMP。当我运行测试时,它显示服务器现在正在使用端口 80。在我更改之前,测试显示它正在被 Skype 使用
-
你可以从命令行使用 PHP 吗?
-
@You 是的,我确实可以,添加截图
-
Apache 是否拥有查看
C:/Users/wesley.smith/Google Drive/的文件夹权限?在 linux 系统上,Apache 需要对树上的每个文件夹都具有执行权限。