我已将Yii
项目从Windows
移至Linux(Centos)
,并将文件夹和文件权限更改为read
和write
,但访问后,发生了错误:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
在错误日志中:
[Sat Apr 27 14:54:50.753643 2013] [core:alert] [pid 2153] [client ::1:40135] /opt/lampp/htdocs/ehilal/backend/www/.htaccess: FilterProvider takes three arguments, filter-name provider-name match-expression
.htaccess
部分声明FilterProvider
:
<IfModule filter_module>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
FilterChain COMPRESS
FilterProtocol COMPRESS change=yes;byteranges=no
</IfModule>
如何解决? 谢谢,
答案 0 :(得分:3)
过滤器提供程序指令已从httpd 2.2更改为
此Github issue建议在.htaccess中包含以下修复:
<IfModule mod_filter.c>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html \
text/plain \
text/x-component \
text/xml
</IfModule>
</IfModule>