Home  >  Article  >  Backend Development  >  [PHP]Nginx and PHP file upload size limit,_PHP tutorial

[PHP]Nginx and PHP file upload size limit,_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:19:19779browse

[PHP] File upload size limit between Nginx and PHP,

----------------------- ------------------------------------------------@black Eye Poet www.chenwei.ws

1. Modify three items in the PHP configuration file: vim /usr/local/php/etc/php.ini

 (1)post_max_size = 50M  #Maximum POST data acceptable by PHP

 (2)upload_max_filesize = 50M #Maximum value allowed for file upload

 (3)max_execution_time = 300 #Maximum execution time of each script, seconds (0 means no limit, setting 0 is not recommended)

2. Modify the Nginx configuration file: vim /usr/local/nginx/conf/nginx.conf (If you forget the specific location of the configuration file, you can use locate nginx.conf to find it)

 (1)client_max_body_size 50m #Client maximum upload size 50M

3. Restart PHP: /etc/init.d/php-fpm restart

4. Restart Nginx smoothly: /usr/local/nginx/sbin/nginx -s reload

-------------------------------------------------- -------------------------------------------------- ---

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/875726.htmlTechArticle[PHP]Nginx and PHP file upload size limit, ------------- -------------------------------------------------- ---------@黑eyedpoetwww.chenwei.ws 1. Modify three items in the PHP configuration file...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn