fastcgi mod_fcgid: HTTP request length

最近在win2003 apache+php+fastcgi+mysql  开发环境下,使用wordpress上传图片时,遇到稍大的图片总是会遇到“HTTP error”,但是检查过php.ini发现文件大小限制post_max_size设置的没有问题,查看apache的logs 日志记录才显示了问题所在:

“mod_fcgid: HTTP request length 135567 (so far) exceeds MaxRequestLen (131072)”

原来是fastcgi模式下的设置问题,需要在配置文件.htaccess或者直接在apache的配置文件http.conf 中指明,如下:

<IfModule mod_fcgid.c>   AddHandler    fcgid-script .fcgi   FcgidConnectTimeout  20   # to get around upload errors when uploading images increase the MaxRequestLen size to 15MB   MaxRequestLen  15728640 </IfModule>

里面的“MaxRequestLen”就是fastcgi模式下上传文件也就是http接受的最大文件长度。