【发布时间】:2012-05-07 21:44:45
【问题描述】:
我以前从未遇到过这个问题。我在 /home/ashesh/prog/php/commonfloor.com/listinSearch/ 建立了一个 Zend 项目,index.php 文件位于 ..listingSearch/html/ 内部,.htaccess 文件也是如此。 apache里面的DocumentRoot也正确设置为/home/ashesh/prog/php/commonfloor.com/listinSearch/html/
(Ubuntu 11.10 i386)
每当我尝试通过浏览器访问 127.0.0.1 时,它应该会打开主页,但它会抛出 403 Forbidden 消息,说我无权访问服务器上的 /。
快速浏览 apache2/error.log 文件会发现一些奇怪的东西:
[Fri Apr 27 11:33:22 2012] [crit] [client 127.0.0.1] (13)Permission denied: /home/ashesh/prog/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
有人可以帮忙吗?我对此一无所知,我敢肯定这不是一个大问题。
【问题讨论】:
-
使用 ls -l .htaccess 检查 .htaccess 的权限,看看它是否有合适的权限
-
看起来 Apache 没有在正确的文档根目录中查找。如果使用 VHosts,您的如何配置?
-
.htaccess 权限:-rwxr-xr-x
-
ServerAdmin webmaster@localhost DocumentRoot /home/ashesh/prog/php/commonfloor.com/listingSearch/html/ ... -
如果您浏览到127.0.0.1/index.php,也会出现同样的错误? [不建议应用程序要求这样做;就像诊断信息一样。也许您禁用了索引(很好)但没有启用 mod_rewrite(显然是一个问题)。]
标签: php apache zend-framework .htaccess ubuntu