304 North Cardinal St.
Dorchester Center, MA 02124

Work Hours
Monday to Friday: 7AM - 7PM
Weekend: 10AM - 5PM

Upload limit increased

WordPress Max Upload Size – Increase Your Limits

I had to increase my WordPress max upload size this week, and it was super simple.

Increase WordPress Max Upload Size – Introduction

During my recent PHP update, I forgot to transfer over all my configuration settings.

In addition to php-gd being missing and messing up my captcha, I also had the default upload size of 8MB set.

I wanted to share how to increase this limit for PHP, which is what WordPress uses by default.

YouTube Version of this Post

If you prefer video and audio over just reading the text, then you can find the YouTube version of this post below.

That said, don’t forget to hit those like and subscribe buttons to help support the blog and channel!

Max Filesize Limit

First, while writing my BunnyType post, I received the following error.

WordPress Max Upload Size - Limit exceeded

After a quick search, I found that the default PHP values were lower than what I would need.

Increasing the Upload Limit

As you can see from my PHP 7.0 file, these were values that I had previously set before my updates.

root@doylernet:~# cat /etc/php/7.0/apache2/php.ini | grep "max_"
; max_input_time
max_execution_time = 30
max_input_time = 60
;max_input_nesting_level = 64
; max_input_vars = 1000
log_errors_max_len = 1024
post_max_size = 12M
upload_max_filesize = 14M
max_file_uploads = 20
odbc.max_persistent = -1
odbc.max_links = -1
;birdstep.max_links = -1
ibase.max_persistent = -1
ibase.max_links = -1
mysqli.max_persistent = -1
mysqli.max_links = -1
;oci8.max_persistent = -1
pgsql.max_persistent = -1
pgsql.max_links = -1
ldap.max_links = -1

First, I increased my post_max_size from 8MB to 13MB. This is the entire body of the POST request, which could have multiple files.

post_max_size = 13M

Next, I increased the upload_max_filesize from 2MB to 12MB. This is the limit for each file, which was what was causing my WordPress errors.

upload_max_filesize = 12M

Finally, I verified that my memory_limit was 15MB, to prevent any upload or timeout issues.

memory_limit = 15M

With all the settings updated, I restarted Apache.

root@doylernet:~# service apache2 restart

When I logged back in to my WordPress instance, the limit was increased and there were no more errors.

Upload limit increased

Increase WordPress Max Upload Size – Conclusion

This was another post that wasn’t exactly security related, but it was something preventing me from blogging.

I’m still enjoying WordPress and recommend it for websites that you don’t want to deal with configuration nightmares on.

Stay tuned for some more research related posts but let me know if there is anything else that you’d like to see in the meantime!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.