我已按照本教程在 Mac OS X 10.8 ( http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion ) 上设置 Apache、MySql 和 PHP
当我转到“Localhost”时,出现以下错误:
Forbidden
You don't have permission to access / on this server.
当我转到“Localhost/~benthompson”时,它工作正常。
当我完成教程的一半时,“Localhost”确实起作用了,后来它停止了它的工作。
大概是权限问题,但在哪里?
最佳答案
要解决该问题,请查看此链接 http://www.coolestguidesontheplanet.com/downtown/how-set-virtual-hosts-apache-mac-osx-109-mavericks-and-osx-108-mountain-lion阅读“丢失本地主机”部分。
在 httpd.conf 文件中启用 vhosts 后,就会发生该错误。
通过取消注释这一行:
Include /private/etc/apache2/extra/httpd-vhosts.conf
在 httpd-vhosts.conf 中添加此项将解决您的问题。请记住在此之前添加新的虚拟主机:D
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
我希望这能解决你的问题!
关于apache - 在 Mac OS X10.8 上访问 localhost 时出现 403 Forbidden 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18750184/