PHP and nginx default upload file size limit solution

Source: Internet
Author: User

The following configuration is done under redhat6.4

PHP Upload file size limit:

1, first find PHP in use of the configuration file

# Php–ini

Output: Loaded configureration file:/usr/loca/php/etc/php.ini

2, edit php.ini

#vim/usr/loca/php/etc/php.ini

3, modify the Upload_max_filesize 10M #默认值是2M

Save, Exit Vim

4, note: toRestart the PHP-FPM, many people said that the change does not take effect is the case.

#service php-fpm Restart

Nginx Upload File size limit

1. Locate the Nginx configuration file and execute the following command in the Sbin directory of the Nginx installation directory

#./nginx-t

Will show the configuration file is correct, in fact we only look at the file location on the line

2, modify nginx.conf

#vim/usr/local/nginx/conf/nginx.conf

3, add the following line to the HTTP segment

Client_max_body_size 10M;

4, restart Nginx

Service Nginx Restart

Finish, and finish the call.


PHP and nginx default upload file size limit solution

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.