Home > Backend Development > PHP Tutorial > PHP fastcgi mode large file upload 500 error_PHP tutorial

PHP fastcgi mode large file upload 500 error_PHP tutorial

WBOY
Release: 2016-07-13 10:39:33
Original
948 people have browsed it

When I uploaded pictures in the project recently, the size was about 300K. As a result, a server error was reported. I have never encountered it before. The error content is as follows:

PHP fastcgi模式大文件上传500错误 帮客之家

mod_fcgid: www.111cn.net HTTP request length 132296 (so far) exceeds MaxRequestLen (131072)

After checking the information, I found that the default request size of fastcgi is 131072, so I just added the MaxRequestLen configuration in the apache configuration. If you only need to modify the MaxRequestLen of a single virtual host, it turns out to be a setting problem in fastcgi mode. You need to specify it in the configuration file .htaccess or directly in the apache configuration file http.conf, as follows:

The code is as follows


AddHandler fcgid-script .fcgi
FcgidConnectTimeout 20
# to get around upload errors when uploading images increase the MaxRequestLen size to 15MB
FcgidMaxRequestLen 15728640

 代码如下  


  AddHandler    fcgid-script .fcgi
  FcgidConnectTimeout  20
  # to get around upload errors when uploading images increase the MaxRequestLen size to 15MB
  FcgidMaxRequestLen  15728640

If you are in a php+apache windows environment, we can configure it as follows

Found in php.ini

upload_max_filesize, and other post_max_size, max_input_time, memory_limit, max_execution_time configuration

Modify the upload size and restart apache to solve the problem.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/730236.htmlTechArticleWhen I uploaded pictures in the project recently, there were about more than 300K, and a server error was reported. Previously, from Never encountered it before. The error content is as follows: mod_fcgid: www.111cn.net HTTP request le...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template