Increase upload size using php.ini or .htaccess

Increase upload size using php.ini or .htaccess

For some reason, I came across issues today, from 3 different sites, relating to limiting upload size.  The default upload size on many hosts is very limiting.  Most allow you to override using php.ini or .htaccess

If you have access to your php.ini, this is the recommended method.  Either create a new php.ini or edit the existing file and put in your root web folder (htdocs, public_html, etc):

upload_max_filesize = 10M
post_max_size = 10M

If that doesn’t work or you don’t have access to php.ini, try .htaccess:

php_value upload_max_filesize 10M
php_value post_max_size 10M

To be extra safe if you’re using PHP5 (which you better be):

<IfModule mod_php5.c>
php_value upload_max_filesize 10M
php_value post_max_size 10M
</IfModule>

 

Comments are closed.