Thursday, September 4, 2025
HomeGuest BlogsHow to Increase file upload size limit in php-Nginx

How to Increase file upload size limit in php-Nginx

Increase or set php file upload limit with php fpm and Nginx; Through this tutorial, we will learn how to increase or set php file upload limit with php fpm in Nginx.

How to Increase file upload size limit in php-Nginx

Just follow the following steps to increase or set PHP file upload limit with PHP FPM and Nginx:

  • Step 1 – Edit php.ini file
  • Step 2 – Edit Nginx conf file
  • Step 3 – Restart Nginx Server

Step 1 – Edit php.ini file

First of all, open terminal or command prompt and execute the following command on command line to open and edit php.ini file:

nano /etc/php5/fpm/php.ini

Once the above command has been executed, Then the php.ini file will open on the terminal. So update it by searching the line given below:

upload_max_filesize = 150M
post_max_size = 150M

Step 2 – Edit Nginx conf file

Execute the following command on the command line to open and edit nginx conf file:

nano /etc/nginx/nginx.conf

Once the above command has been executed, Then the ngnix conf file will open on the terminal. So update it by searching the line given below:

http{
....
.....
....
client_max_body_size 150m;
client_body_timeout 120;
......

Step 3 – Restart Nginx Server

Finally execute the following command to restart Nginx and PHP-FPM:

service nginx restart
service php5-fpm restart

Conclusion

Through this tutorial, we have learned how to increase or set php file upload limit with php fpm in Nginx.

Recommended Linux Nginx Tutorials

RELATED ARTICLES

Most Popular

Dominic
32261 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11795 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6747 POSTS0 COMMENTS
Ted Musemwa
7023 POSTS0 COMMENTS
Thapelo Manthata
6695 POSTS0 COMMENTS
Umr Jansen
6714 POSTS0 COMMENTS