PHP fastcgi mode large File upload 500 error

Source: Internet
Author: User
Tags apache windows file upload http request

Recently uploaded pictures in the project, about more than 300 k, the results reported a server error, never encountered before, the error is as follows:

Mod_fcgid:www.111cn.net HTTP Request Length 132296 (so far) exceeds Maxrequestlen (131072)

Check the data, found fastcgi the default request size is 131072, so in the Apache configuration to add Maxrequestlen configuration is good. If you only need to modify the Maxrequestlen of a single virtual host, it is a setup problem in fastcgi mode, which needs to be specified in the configuration file. htaccess or directly in the Apache configuration file http.conf, as follows:

The code is as follows

<ifmodule mod_fcgid.c>
AddHandler Fcgid-script. fcgi
Fcgidconnecttimeout 20
# to get around upload errors when uploading images increase the maxrequestlen size to 15MB
Fcgidmaxrequestlen 15728640
</IfModule>

If you are php+apache Windows environment, we can configure the following

Found in the php.ini.

Upload_max_filesize, and other post_max_size, Max_input_time, Memory_limit, max_execution_time configuration

The upload size changes after the restart of Apache can be resolved.

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.