PHP / Nginx: Increase max file upload and post max size

people

Lets Try

. min read

Firstly, you need to locate your php.ini file. In this example, our php.ini file is located in /etc/php/7.4/fpm/php.ini


sudo nano /etc/php/7.4/fpm/php.ini


In nano - 

Press CTRL + W and search for upload_max_filesize and change the value to 128M (for 128 megabytes).


; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 128M


Press CTRL + W and search for post_max_size and change the value to 128M (for 128 megabytes).


; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 128M


Save file and exit. (Press CTRL + X, press Y and then press ENTER)


Now restart PHP-FPM


service php7.4-fpm restart


You may also need to edit the Nginx configuration file.








More Stories from

Lets Try
Lets Try.1 min read

Deploy Tailscale in Portainer docker container Raspberry pi

A comprehensive guide on deploying Tailscale through Portainer in Raspberry pi. lets integrate Tailscale into your existing Docker setup.

Lets Try
Lets Try.1 min read

Nginx Proxy for s3 compatible storage & buckets

Nginx can be used as a reverse proxy for S3 compatible storage and buckets. This is useful in many scenarios, including adding authentication, security or custom routing to S3-compatible solutions. 

Dev
Dev.2 min read

Window Server 2025 Contabo VPS Install Guide

Window server in contabo is very costly but you can deploy your license key with custom image.

Dev
Dev.1 min read

Setting up SSH keys to a Ubuntu Server with Mac

Generating SSH keys on a Mac for use with an Ubuntu server is a straightforward process. Here’s a step-by-step guide: Generate the SSH Key Pair

.
Dev
Dev.1 min read

Git/Github Clone Private Repository on Ubuntu Server 24.04

GitHub is a free platform that provides repository hosting and We will guide you to install Git on Ubuntu 24.04, adding and cloning a repository from GitHub to your Ubuntu VPS server.

.
Built on Koows