Solution for WordPress HTTP error when uploading media – Denis Sandmann

This post contains advertising and promotional links.

Yes, WordPress also has those little woes that pop up every now and then. Today I am writing about that HTTP error when uploading media to the WP media library and what it is all about.

The error is actually very easy to explain, but since the error message was chosen so carelessly, many here don’t know what to do.

If the error message “HTTP error” or “HTTP Error” appears when uploading images, videos, MP3 files or similar media files, this is usually due to the limited upload limit of the WordPress installation or the server configuration.

Let’s assume that the server or the WP installation has entered an upload limit of 5 MB, now someone uploads an image with a size of 6 MB, the error message appears because only 5 MB are allowed for the upload.

The limit for the file size when uploading is determined by 2 factors: the server configuration and the configuration of the WordPress installation.

So there are 3 possible solutions to the problem:
1. File size reduction
2. Increase the upload limit via the WordPress configuration file
3. Increase the upload limit via the server configuration file

1. Simplest solution: reduce file size

In most cases, images will probably be uploaded to the WordPress media library. If you shoot pictures with a SLR, you will quickly end up with a file size of 4 – 10 MB. Smartphones also often produce high-quality images that come with a similar file size. If you now load the images directly from the camera into the WordPress media library, then of course it can happen that you get the HTTP error mentioned.

Remedy here is to reduce the file size. This works e.g. B. with programs like Photoshop, XNView or Lightroom.

You load the images that are too big into the program and reduce the resolution and the JPG quality. I export my images from Lightroom with a maximum width of 1920 pixels and a JPG quality of level 8. Then they usually have a file size of 1 – 2 megabytes. Only then do I load the images into my WordPress installation. The upload is so much faster, I save valuable storage space on my server and I don’t get the HTTP error.

If this solution doesn’t work, you have to increase the upload limit manually.

2. Solution: Increase the upload limit of the WP installation

To increase the WordPress installation upload limit, log on to the FTP server where the WordPress installation is located and navigate to the “wordpress” directory. There you find the “wp-config.php” file and edit it.

Write the following line at the end of wp-config.php to increase the upload limit to 64 MB:
define(‘WP_MEMORY_LIMIT’, ’64M’);

Then save and close the file. If that still didn’t help, then you should edit the .htaccess and the php.ini file.

3. Solution: Increase the server’s upload limit

The server configuration can also set an upload limit for PHP scripts (like WordPress). I recommend a setting in the wp-config.php of the WordPress installation and setting a limit in the .htaccess and php.ini files.

To set or change an upload limit, first go to the installation directory of the WordPress installation on the FTP server. The files may already be here: .htaccess and php.ini

If not, then you can of course create the files yourself.

To e.g. For example, to increase the upload limit to 64 MB, write the following lines in the .htaccess file:
php_value
upload_max_filesize 64M
php_value post_max_size 64M

In addition, I recommend these lines to increase the script runtime:
php_value max_execution_time 300
php_value max_input_time 300

Then save and close the file.

In order to transfer the same settings to php.ini as well, write the following lines in the php.ini file:
upload_max_filesize = 64M
post_max_size = 64M

Again, an additional line to increase the script runtime:
max_execution_time = 300

Then save and close the file. Now the upload limit of the WP installation should be increased and the upload should work without an error message.

Keep in mind that an upload limit is also used for security. Because not every WordPress user is well acquainted with computer technology. The upload limit saves storage space and prevents the upload of unnecessarily large files. Even a possible hacker attack could not end so fatally with strict rules. In my opinion, 64 MB upload limit is completely sufficient for most things. If you have to upload larger data to the WP installation, I recommend increasing the upload limit only temporarily.

When do we photograph / film your project?
Tell me… Who are you? What are you doing? Where do you come from? What you up to? Show me your project, your company, your vision. Commercial, non-profit or just because.

Learn more about my service!
Will we stay in contact?
There are many good reasons to subscribe to someone’s newsletter, follow someone on Instagram, or like a Facebook post. Maybe you’re bored, just want to stay up to date, who knows… Subscribe to this blog via FB, IG, YT or via newsletter!

Subscribe to this blog!