nginx:413 Request Entity Too Large Processing Method--Modify PHP upload file size _nginx

Source: Internet
Author: User
Tags phpmyadmin

Development environment: CentOS + Nginx + PHP + MySql + phpmyadmin

In the use of phpMyAdmin SQL database import, often need to upload large SQL data files, and at this time will often encounter Nginx error: 413 Request Entity Too Large.

To solve this problem, depending on the size of the uploaded data file, you need to adjust the parameter configuration in two locations:

1, php default upload file size limit of 2M, if more than 2M you need to modify the PHP configuration file php.ini inside the parameters

Post_max_size = 8M (the maximum limit for form submissions, which is not to limit the size of an uploaded individual file, but to limit the data submitted by the entire form). )

Upload_max_filesiz e = 2M (maximum limit of individual files uploaded)

Need to guarantee post_max_size >= Upload_max_filesize, namely the former is not less than the latter.

Be sure to restart PHP-FPM after the modification.

2. In addition to modifying the PHP configuration, you also need to modify the Nginx configuration file nginx.conf

Open the Nginx profile nginx.conf, locate the http{} segment and add one row of configuration to it:

Client_max_body_size 8m;
8m can be uploaded according to the size of the file itself set.

Be sure to reload the Nginx (service Nginx Reload) after the modification.

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.