[英]YII (PHP Framework) and OSX (El Capitan)
升级Mac OSX之后,我的开发环境停止工作。 我不确定这是否与apple提供的apache有关,但是发生的是,当我尝试访问该应用程序时,它抱怨找不到所需的文件。
我有以下.htaccess文件:
RewriteEngine on
RewriteRule ^install\/ ./index.php?r=install/main/index [L,QSA]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
DirectoryIndex index.php
addDefaultCharset utf-8 code here
在httpd.conf上,我启用了php和重写模块。 我还在httpd.conf中的Directory扇区中将AllowOverride设置为All。
这些是我尝试访问时遇到的错误:
另外,当我尝试访问yii上映射的任何其他URL时,也会出现相同的错误404 Not Found。
任何想法?
在此先感谢和问候,Edu
您可能没有在Apache设置中启用mod_rewrite。
确保在/etc/apache2/httpd.conf
未注释掉该行:
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
抱歉,我只是注意到我将AllowOverride All设置为错误的位置。 我只是将其设置在正确主机的目录中,并且它起作用了。
谢谢并恭祝安康。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.