How to Increase File Upload Size in PHP


Hello Guys, In this tutorial I would like to show you How to Increase File Upload Size in PHP.

So Let’s get started.

Step1. Login To Your Server

Firstly need to connect to your server using SSH.

After That,

Go to the folder where php.ini located eg. If you are using Debian/Ubuntu Go To :-

$ nano /etc/php/7.4/apache2/php.ini

If you are using Cent/RHEL/Fedora. Go To :-

# nano /etc/php.ini

Also Read: Create Own File Sharing Website

Step2. Making Changes

After opening the php.ini file in the nano editor

Find these two lines as shown below.

upload_max_filesize = 2M

post_max_size = 2M

Need to modify the value of upload_max_filesize and post_max_size variables in your php.ini file.

If you want to increase the upload size 2GB.

Replace 2M to 2048M

After changing value it looks like this

upload_max_filesize = 2048M

post_max_size = 2048M

Also Read: Earn Money Online

Then save your files and restart your server.

In Nano Editor,

Press CTRL + X then Y and Press Enter

After Saving the file needs to restart the server.

Step3. Restart Your Apache Server

If you are using Debian/Ubuntu.

$ sudo service apache2 restart

If you are using Cent/RHEL/Fedora.

# systemctl restart httpd.service

All Done.

More About PHP INI: click here


So in this article, I show you How to Increase File Upload Size in PHP. It can easily increase your file uploading limit on your server.
If you have any doubt or find any mistake on post. Leave comment below or contact to

Thanks For Reading 😊

Hire Us for Digital Services :- Script Installation, Website Design & Development, VPS Configuration. Telegram Contact :-@Developer107