将Yii样板项目从Windows移动到Linux时出错


Error When Moving Yii Boilerplate Project From Windows to Linux

我已经将Yii项目从Windows移动到Linux(Centos),也将文件夹和文件权限更改为readwrite,但访问时发生错误:

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>

如何修复?谢谢你,

过滤器提供程序指令从httpd 2.2:

这个Github问题建议在.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>