How to Increase the PHP Upload Limits

If you are able to upload small files with PHP script but unable to upload larger files it means you will need to increase upload_max_filesize limit in your php.in file.

In this article I will show how you can increase upload_max_filesize for your website.

PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less.

Increase PHP Upload Limits

Try increasing the following values in php.ini, for example:

memory_limit = 20M
upload_max_filesize = 12M
post_max_size = 20M

After making these changes, you may need to restart Apache. You can do so through Plesk or via SSH with the following command:

# /etc/init.d/httpd restart

If the upload_max_filesize is larger than post_max_size, you must increase post_max_size so that it is bigger than upload_max_size.

If the value of post_max_size is larger than memory_limit, you must increase memory_limit so that it is larger than post_max_size.

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment