Increase File Upload Size WordPress

We see this error when we upload a file that bigger than upload limit size , the error look like this “exceeds the maximum upload size for this site”

fileuploadsize

The web hosting company may set  limit to file upload size, fortunately we could workaround this problem and increase file upload size WordPress.

1. PHP.INI

UPDATE PHP.INI to increase file upload size WordPress

If we have access to root admin, we could locate where php.ini file is by using phpinfo, just create a file name wherephpini.php, add following code to wherephpini.php and upload it to our root folder in your server

<?php phpinfo(); ?>

Open wherephpini.php in the browser, look for Configuration File (php.ini) Path .
Open php.ini in that configuration path, find and change following constants

e.g from

upload_max_filesize = 2M
post_max_size = 2M

to

upload_max_filesize = 64M
post_max_size = 96M

CREATE PHP.INI to increase file upload size WordPress

If we don’t have root admin and host our site on shared hosting, just create php.ini and add following constants to newly created php.ini. Upload php.ini to wp-admin directory

upload_max_filesize = 64M
post_max_size = 96M

Some web hosting may have different configuration that requires additional constants to make it work

memory_limit = 128M
upload_max_filesize = 64M
post_max_size = 96M
file_uploads = On

</pre>
2. htaccess file
Open .htaccess in root folder, you could use Control Panel File Editor or FTP
Add following constant to .htaccess file
<pre>

php_value upload_max_filesize 64M
php_value post_max_size 96M

Some web hosting may have different configuration that requires additional constants to make it work

php_value memory_limit = 128M
php_value upload_max_filesize = 64M
php_value post_max_size = 96
php_value file_uploads = On

We could increase Max upload size on WordPress Multisite/Network after we have increase maximum file upload size with one of methods above

Go to WP-Admin > My Sites > Network Admin > Settings > Upload Setting, change KB in Max upload file size from 1000 KB to 32000 KB (32MB)


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: