May 20, 2022

How to change the maximum upload file size for PHP scripts

In this article i will be taking about php upload file size, many of user face this problem and don’t know how to increase the upload_max_filesize. By default php will restrict you to a maximum size of 2MB of upload file size.

So the question is how can we change the maximum upload size?

Its very simple, you just have to edit your php.ini file on your server, this file basically resides in /etc directory.

To do so just open the php.ini file with your favourite editor and edit the following line as follows:-

; Maximum allowed size for uploaded files.

upload_max_filesize = 40M ;

Must be greater than or equal to upload_max_filesize post_max_size = 40M

After modifying php.ini file, you will need to restart your httpd/apache server to use new configuration.

Vedant Singh

Linux System Administrator | Entrepreneur | Founder Techmion. I have started my career as a Linux system Administrator after that quit my job to start something new that excites me and started a Tech Company in order to provide the best technology to my clients. My Company website link: For Bulk, SMS-Marketing follows the link :

View all posts by Vedant Singh →

Leave a Reply

Your email address will not be published. Required fields are marked *


Ad Blocker Detected!

We've noticed that you are using an ad blocker. Advertising helps fund our server cost and keep it truly independent. It helps to build our content creator team. So please disable your ad blocker, and help us to keep providing you with free- great content - for free. Thank you for your support.