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

author

Lets Try

. min read

Follow

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 Developerbook

Install Premium URL Shortener in DigitalOcean Cloud Server

Install Premium URL Shortener in DigitalOcean Cloud Server

How To Import and Export Large Database files in MySQL or MariaDB

How To Import and Export Large Database files in MySQL or MariaDB

How to setup Erlang on windows environment

How to setup Erlang on windows environment

How to configure eclipse plug-in for erlang

How to configure eclipse plug-in for erlang

Isolation concept for transaction

Isolation concept for transaction