HTTP error when uploading an image to WordPress is one of most frustrating error for non-tech WordPress users. especially, when all you was trying to do is to create content for your site and in return all you are getting is errors. I know it’s damn annoying right now.
So, how you can fix it?
well, It can be cause by many reasons and the one which work in most cases is to increase your php memory limit
what is PHP memory?
PHP memory is the limit a single process(like you trying to upload a image, or visitor click something on webpage is allowed to use.
The job of this PHP process is to generate some HTML to throw back at the visitor or what ever you ask to server, it delivers via PHP process – the PHP process provides a run time to a PHP script that should be doing that.
Why you getting HTTP error than?
The memory limit is the maximum amount of memory this process can use. If you exceed it, the process fails and Apache reports an HTTP 500 error.
Okay, Thanks for all the Info.
How can I fix http error than?
well you should understood by now, If PHP memory limit exceeding the limit, all you have to do is Increase the limit.
How to increase php memory limit
- You need to have access to FTP. Go to root folder and found the file in root directory called wp-config.php. Right click on file and choose option ” view/edit file” . paste the code below at very bottom of the file
define( 'WP_MEMORY_LIMIT', '256M' );
Please note, 256 in the above code is php memory limit to process something on your server. I will personally not use more than 256 MB for normal WordPress website. You could try just 128M only. To be on safe side
If you are already wondering to you use more memory than. STOP
PHP memory limit should be set as low as possible like 128 Mb may be or within the bounds of what you need. The memory limit is applied to each individual concurrently executing script, not globally. Setting it low will help ensure that if you make some mistake that causes e.g. an infinite loop, the script will be stop early rather than spiralling out of control and grinding the entire server to a halt.
- You can also try increasing your memory by adding the following in your .htaccess file. This will only work if your hosting package has that amount of memory. Increase gradually until you are able to upload an image size which is acceptable by you.
Note: Some web hosting does not allow this and you will have a 500 internal server error. In this case you will have to remove this code.
php_value memory_limit 256M
- If you have some code-phobia. simply, ask your hosting comapany to do it for you.
In some cases it can be just Plugin conflict
- You may have installed a plugin that’s causing this issue. Please proceed to disable one plugin at a time. Clear your cache and browser history and revisit media up loader to upload your image ( keep the pixel size small ) and see if you are successful.
Does it solve your problem? let me know if any question or facing any issue.