Home > Article > Backend Development > [PHP]Nginx and PHP file upload size limit,_PHP tutorial
----------------------- ------------------------------------------------@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
-------------------------------------------------- -------------------------------------------------- ---