This error may be caused by different reasons, this article shows how to investigate and resolve it. After reading this article, you will be able to get rid of this error and upload the images to your site. You will need access to your server from your hosting site or through FTP for some methods explained below.
All steps described in this article include screenshots. Thus, making it easy for all WordPress users to follow them.
Solutions explained in this tutorial are the following:
- Disabling all plugins and themes from the Dashboard
- Increasing memory limit through cPanel
- Increasing memory limit through FTP
- Checking directory permissions using cPanel
- Checking directory permission using FTP
Solution 1 for the Error “WordPress HTTP error uploading images”:
The first cause of this problem is a plugin/theme incompatibility or failure preventing you from uploading images.
To discard this as the cause, you need to disable plugins and themes.
To begin, log in to your WordPress dashboard and move your mouse pointer over Plugins in the left menu. Then, press the Installed Plugins option as shown in the screenshot below (Plugins>Installed Plugins):
Once in the Plugins screen, press the Bulk actions dropdown menu and select the Deactivate option as shown in the following image:
Then, select the box next to Plugin to select all plugins, and press the Apply button as shown below:
Now that all your plugins are disabled, let’s continue disabling your theme.
On the dashboard left menu, move your mouse pointer over Appearance and press Themes (Appearance>Themes).
Once in the Themes section, enable another theme instead of the one you are using. You can enable the Twenty Twenty-One theme, which comes included by default in WordPress.
Try to upload the image again. If it works, you need to enable back your theme and plugin while trying to upload the image again to find the plugin or theme generating the problem. In other words, enable the plugins individually while testing the upload each time you enable it to identify the problematic plugin or theme.
When you find the plugin or the theme that generates the problem, check for updates or contact the support team if you badly need it. You also may opt to implement a plugin alternative to the problematic one.
Solution 2 for the Error “WordPress http error uploading images” (cPanel):
In some cases, the error may be caused by an insufficient PHP memory limit.
This section shows how to increase the PHP memory limit from the wp-config.php file. The following section shows how to do it from the cPanel. If using an FTP client, jump to this section for proper instructions.
To increase the PHP memory limit in your WordPress files, access your cPanel account and on the main screen, select the File Manager as shown in the screenshot below:
Once in the File Manager, find the wp-config.php file, right-click it and press the Edit option.
When a confirmation request shows up, just press Edit to continue.
Find the line /* That’s all, stop editing! Happy publishing. */ and just before it, paste the following line, where 256M can be increased for the memory limit you want to set.
Press the Save Changes button once the line is added to apply changes.
Now, try to upload the image again. If the error message remains, there is a possibility your memory limit is limited from cPanel settings. Keep reading below to discard that possibility.
Increasing the PHP Memory Limit From the cPanel:
In case the previous solutions didn’t work, there is a chance your memory limit is limited from the server. If you are using the cPanel, access it and, from the main screen, press Select PHP Version as shown in the following screenshot:
In the PHP Selector screen, press the Options tab as shown below:
Scroll down and find the line containing memory_limit. Change the value for a higher one, as shown below:
Once increased, changes take effect automatically without pressing a save button.
Now, check if you can upload the image again.
Solution 3 for “WordPress HTTP error uploading images”, Checking Directory Permissions (cPanel):
If the solutions mentioned previously didn’t work, you probably have a problem with the directories’ permissions. To check this access of your cPanel account and in the main screen, select the File Manager.
Once in the File Manager, go to your website root directory and check the directories’ permissions. They must be 0755. If your permissions are not properly assigned, keep reading below:
If you have your directory’s permissions not properly configured, right-click each directory and press the Change Permissions option as shown below:
Define your permissions correctly and press the Change Permissions button to apply changes. Your permissions must be similar to the image below:
Below, you can find instructions for FTP clients.
Checking Directory Permissions Using FTP:
Connect to your server using an FTP client. On your site’s root directory, check each directory permission by right-clicking them and pressing the File Permissions… option (If you are using FileZilla or a similar option in another client, click “Settings”).
Check all permissions are granted to the owner, reading and writing permissions for the group and public reading and execution permissions by inputting the numeric value, 755, as shown below:
Increasing Memory Limit Using FTP:
This section shows how to increase the memory limit in the wp-config.php file using an FTP client. For this tutorial, I will use the FileZilla FTP client.
Connect to your server and move to the site files’ root directory containing your site files. Find the wp-config.php file, right-click it or press View/Edit or Download.
In the following screenshot, press View/Edit:
Alternatively, you can press the Download button.
Once downloaded, find the line “/* That’s all, stop editing! Happy publishing. */” and paste the following line above it, as shown in the screenshot below:
Then, upload the file back to your server root directory.
When asked for confirmation to rewrite the existing file on your server, confirm it by pressing the OK or Accept button.
Now, check if you can upload your image. If you can’t, you may need to increase the memory limit from the server, as described in the previous section of this article
Conclusion:
As you can see, researching the reason for the error when uploading images in WordPress can be a little challenging. There are several reasons to discard. Yet all the methods are easy to follow by all WordPress user. Keep in mind that you will need access to your server, at least through FTP, except for the first method carried out from the Dashboard. If you don’t have access to the server PHP configuration, you will need to contact your hosting provider to request access and the memory limit increase.
Thank you for reading this tutorial explaining how to solve the “WordPress HTTP error uploading images” error. Keep following Linux Hint for more professional tutorials.