Increase PHP Maximum File Upload Size

  • Avinash
  • 0
  • Jul 14, 2011
  • Web Development

In most of the websites file upload feature is a comman in now a days. For some advanced websites like video and audio sites you need to upload large files.

By default PHP have very few MB of upload limit. But not a proble at all. You can increase upload file size limit in two ways.

php.ini method

If you have an access to your php.ini file then you just need to place the below code in your php.ini file or replace the existing parameters with below one:

upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

.htaccess method

Now if you don’t have an access to your php.ini then you can change these parameters from .htaccess file as well. copy below code in your .htaccess file and you are ready to go.

php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

Note: Second trick may not work if you are on shared hosting.

Related Posts

Written by Avinash

Avinash Zala currently working at a leading web development company as a Sr. PHP Web Developer. He is the founder of the Xpert Developer. He has completed B.E. in Information Technology. Born and brought up in Ahmedabad. He loves to code and coding is all about passion for him. Follow him on twitter at Avinash Zala & Xpert Developer.

View all posts by: