PHP fastcgi mode uploads large files (more than 300 K) and reports an error,
When uploading images in a project recently, there were more than 300 K results. A server error was reported, which was never encountered before. The error details are as follows:
Mod_fcgid: HTTP request length 132296 (so far) exceeds MaxRequestLen (131072)
After checking the information, we found that the default request size of fastcgi is 131072, so we can add the MaxRequestLen configuration in apache configuration. If you only need to modify the MaxRequestLen of a single virtual host, it turns out that the Setting Problem in fastcgi mode needs to be done in the configuration file. htaccess or http. conf:
The Code is as follows:
Copy codeThe Code is as follows:
<IfModule mod_fcgid.c>
AddHandle fcgid-script. fcgi
FcgidConnectTimeout 20
# To get around upload errors when uploading images increase the MaxRequestLen size to 15 MB
Fcgidmax requestlen 15728640
</IfModule>
If you are using php + apache windows, we can configure the following:
In php. ini, find
Upload_max_filesize, and other post_max_size, max_input_time, memory_limit, and max_execution_time configurations
Modify the upload size and restart apache.