How to increase the size of uploaded files in PHP

The standard maximum size of the file that you can upload in PHP is 2MB, but some scripts require an increase of this size.

Just create a file named php.ini in your computer and upload it to the folder of your web hosting, which you want to change the maximum size for:

upload_max_filesize = 10M
post_max_size = 20M

This will increase the maximum size of uploaded files in PHP from 2MB to 10MB. Note that post_max_size should be twice larger than upload_max_filesize.

  • 203 Users Found This Useful
Was this answer helpful?

Related Articles

What is the path to Perl

The first thing you should do is adjust your scripts to use the correct path to the Perl...

Disable TRACE or TRACK method in Apache web server

If you like to keep your VPS hosting server or dedicated server secure you may need to disable...

Options, IndexOptions, DirectoryIndex, ErrorDocument with .htaccess

1. Authorization and prohibition on listing the content of the folderWhen you open a website...

Permissions of the PHP files

To avoid problems, it is best to set the permissions of PHP scripts to a maximum of 755.

PHP version

You can see the version of PHP when you log in your web hosting control panel and select “Server...