July 15, 2024

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 Kumar

Currently I'm working as an Implementation Engineer, Started my career as an System Administrator - Linux. Additionally loves to explore new technologies and research about new open-source software that ease the development cycle.

View all posts by Vedant Kumar →

Leave a Reply

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

The reCAPTCHA verification period has expired. Please reload the page.


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.