PHP fastcgi mode running PHP file Upload MaxRequestLen error solution

Source: Internet
Author: User
Tags file upload http request php file php file upload

When you use phpmyadmin to import data to apache2.4.9 + php5.4, the server error 500 is displayed. View logs and find

Mod_fcgid: HTTP request length 135024 (so far) exceeds MaxRequestLen (131072)

It means that the request is too long, but you have never seen MaxRequestLen before. You can search for it in httpd. conf. No, and search for it in php. ini. I had to go to Baidu. The reason seems to be that the default request data of the later version of apache has been reduced, and it is also the reason why fcgi runs. Anyway, no matter what, there is only one solution:

Add one in httpd. conf

# Modifying fgci request restrictions
# MaxRequestLen 5242880

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

Then restart apache and no error will be prompted.

Note: If you only need to modify the MaxRequestLen of a single virtual host, you only need to add it to virtualhost. If it is global, add it to httpd. conf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.