WordPress – HTTP Error

KB ID 0001335 


Quite a few times after I rebuilt my server, (and WordPress site), I saw the following when uploading images etc.

HTTP Error WordPress

HTTP Error


I was quite sure everything was setup OK, I had set the max file upload limits set, but it turns out I needed to add a ‘memory limit’ in my wp-config.php file before the error ceased. For completeness I’ll include the other usual suspects, in case yours is setup a little differently from mine.

Edit Your php.ini File

Note: If you are running an earlier version of php, your path may be different.

sudo nano /etc/php/7.0/fpm/php.ini

Ensure the following has been set;

upload_max_filesize = 50M
max_file_uploads = 20
post_max_size = 50M

Edit Your nginx.conf File

(Obviously don’t do this if you are running Apache!)

sudo nano /etc/nginx/nginx.conf

In the very bottom of the http section, (before the end ‘curly’ bracket ‘}’), add in the following;

client_max_body_size 100m;

Edit Your wp-config.php File

sudo nano /var/www/html/wp-config.php

Add the following to the very bottom of the file;

define('WP_MEMORY_LIMIT', '120MB');

Related Articles, References, Credits, or External Links


Author: PeteLong

Share This Post On

Submit a Comment

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