gpt4 book ai didi

php - .htaccess 抛出 403 Forbidden/Zend Framework 快速启动项目创建 (Mac OS X 10.6.5)

转载 作者:可可西里 更新时间:2023-11-01 13:48:33 27 4
gpt4 key购买 nike

我正在尝试启动并运行 Zend Framework 的快速入门教程,但我遇到了 .htaccess 问题。似乎如果我删除 .htaccess 文件,项目运行正常,但如果我把它留在那儿,它会抛出 403 Forbidden。 .htaccess 是 Zend Framework 控制台命令生成的默认文件。这是 .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

这是在 Mac OS X 10.6.5 下

mod_rewrite 开启允许覆盖所有

这是我的虚拟主机信息

<VirtualHost *:80>
ServerName zf_cms.local
DocumentRoot /Users/kjye/Sites/zf_cms/public
SetEnv APPLICATION_ENV "development"
<Directory /Users/kjye/Sites/zf_cms/public>
Options +Indexes +FollowSymLinks +ExecCGI
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

我通过添加“Options +Indexes +FollowSymLinks +ExecCGI”修复了它,感谢观看。

最佳答案

<VirtualHost *:80>
ServerName zf_cms.local
DocumentRoot /Users/kjye/Sites/zf_cms/public
SetEnv APPLICATION_ENV "development"
<Directory /Users/kjye/Sites/zf_cms/public>
Options +Indexes +FollowSymLinks +ExecCGI
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>

事实证明这在 mac os 下可以工作。感谢所有的帮助和评论。

关于php - .htaccess 抛出 403 Forbidden/Zend Framework 快速启动项目创建 (Mac OS X 10.6.5),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4262270/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com