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

Where to put CGI files

CGI files will work from any folder on your hosting. However, we advise you to keep them in...

Internal Server Error or Error 500

Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable...

PHP modules installed on the web hosting

Normally the web hosting servers have standard installation of the following PHP modules:...

Can I use short tags in PHP scripts

Yes you can. The settings of PHP (short_open_tag) allow you to use short tags in PHP scripts.

Execution of HTML as PHP

To be able to handle php script in .html file , you need to add the following in the .htaccess...