Tips and tools for WordPress, Google and more
WordPress file upload problems
Update of the article: 2022-04-10
Sometimes it can happen. On the same server on which several WordPress blogs are installed side by side, uploading files to a WordPress website does not work. And not around the castle. So there are no excuses about safe mode=on or file uploads not being possible. It works on the neighboring sites, but not on this one installation.
Regardless of whether you upload via the media library or when creating a new article or page: the upload will start, but the file will not end up in the uploads
-folder. Even if the media library thinks otherwise. And it doesn't matter whether it was a picture or an MP3 file. What now?
A glimmer of hope - the memory limit?
Perhaps the upload problem only affects images. After an image has been uploaded, it is processed by WordPress and smaller versions of the image are created. However, this cannot work if the working memory is too small. This concerns
- the total amount of memory that is released for the execution of the PHP programming language for your website (PHP memory limit),
- the memory available to the frontend of your WordPress website (WP memory limit),
- and the memory available to the backend of your WordPress website (WP max memory limit),
Let's take a look at the working memory available to your website, the PHP memory limit. With for example memory_limit=64M
PHP is stored in the file php.ini
is allocated a usable working memory of 64 MB. This may be sufficient for the usual use of a WordPress website with just a few plugins and a few widgets, but hardly more for editing larger images.
If you can upload a small image (let's say with the dimensions 20 x 20 pixels) without encountering the problems of uploading a larger image, then you should set this memory limit higher. Or upgrade your hosting product if this means that you can work with a larger value for memory_limit
be considered.
The value for the PHP memory limit can be found under "Tools / Website status / Reports / Server":
However, it may also be the case that your WordPress is saving too little memory (WP_MAX_MEMORY_LIMIT) for the Backend conceded. You can then correct this yourself.
Use FTP to download the file wp-config.php
from your web server to your own computer. You will find this file in the top directory of the website. With good providers, you can also edit the file directly in your customer administration area (the section is most likely called FTP or Web FTP).
Open the file in a text editor (Windows: Editor, Notepad++or similar; MacOS: TextEdit or similar).
Search for the line /* That's all, stop editing! Happy publishing. */
resp. /* That's it, no more editing! Have fun. */
and insert the following line immediately before it.
define( 'WP_MAX_MEMORY_LIMIT', '256M'
);
With this line, you instruct WordPress to set the WP memory limit for the backend area to 256MB. Perhaps you have even booked a higher-quality hosting product, in which case you can 512M
enter.
For the Front end WordPress websites do not usually require that much RAM, so 64MB is certainly enough at the moment.
define( 'WP_MEMORY_LIMIT', '64M'
);
Now save and upload the file to your server again.
Now check in the backend of your WordPress website under "Tools / Website status / Reports / WordPress constants" to see if you were successful.
If this is not yet the case, please contact your hosting provider and ask them to allocate more memory (PHP memory limit) to your website. This is because the WP memory limit cannot exceed the PHP memory limit.
Or the file rights?
The file permissions on the server may not be set optimally. In order for photos to be uploaded, the wp-content/uploads folder must be writable, including all its subfolders.
The default file permissions for most WordPress files/folders are as follows:
- Files: 644
- Folder: 755
Connect with an FTP program (FileZilla) to your server, locate the wp-content/uploads folder, right-click on it and set the file permissions for the directory and its subdirectories to 755.
If this does not work either (does your provider have a special construction?), then try 777 for this directory.
Does it work?
If the upload of picture and sound works again, please write a hymnic comment here. If it doesn't work, but you have found another solution, please let us know.
Would you like to be informed quickly about new articles and more?
Then we recommend that you subscribe to our newsletter "Online Marketing News from E-Werkstatt".
many thanks for the helpful article!!!
i spent hours trying to solve the upload problem and found the solution here. 🙂
I'm glad to hear that 🙂
All the best!
SUPER CLASS !!!
The uploader stopped working from one day to the next.
Nothing worked from the backend and frontend.
The small entry in Settings->Miscellaneous did the trick.
Thank you very much
Hi, I have the same problem, but I have no submenu 'Miscellaneous' ?!
What to do?
Settings -> Media library (has obviously changed with WP 3.0)
Hello,
Thank you very much for these detailed instructions. Variant 3 was the problem for me - i.e. the file permissions. I received the following error message:
The directory /www/htdocs/w00f3442/wp-content//2012/05 cannot be created. Is the parent directory writable by the server?
I had to check three more boxes and now it works.
Best regards
Joerg
Hello,
I was no longer able to upload my images using the media library uploader. I had probably unconsciously changed something. They were apparently there and could also be edited, saved, etc., but were not visible in the media library.
Well, you don't have to know everything - you just have to find where it is ;-).
In any case, the article was very helpful - thanks for that.
Best regards
Reiner
Cool, that makes me happy 🙂
Am I the only one on the net where nothing helps? I've been sitting on this shit for hours and am totally annoyed. All permissions are set to 777. I have nothing from savemode on the server under Plesk. I can't turn anything on or off. It doesn't matter if I put my uploads in month-based folders. I backed up the wp-admin folder, deleted it and uploaded it again via ftp. I can't upload anything, which I do. I have the latest version 3.5.1. Here I find absolutely no possibilities to change the folder for the media library.
Another clever suggestion?
I'm afraid you'll have to contact your provider. If WordPress is not allowed to write anything, then the Unix web user simply lacks the rights.
Thank you - good compilation of possible problems. Missing write permissions are probably the number 1 source of errors.
@Kalle: No...you are (unfortunately) not the only one. I'm also on 3.5.1, tried everything and couldn't get any improvement. ... so I'm probably number 2 😉
Were you able to solve the problem with your hoster? I have my webspace with Alfahosting and have opened a ticket in the meantime. I'll wait for their response and then let you know here what the problem was.
It may be more complicated for you. Perhaps the "Ownerships" of the /wp-content/uploads/ directory have changed.
Example: if WordPress was first uploaded to the server using FTP and then installed, then all files and directories initially belong to the FTP user and their group ("ftp-user:ftp-group"). It is possible, however, that the web server will take ownership at some point in the future (example: "www-data:www-data" for /wp-content/uploads/). In this case, the FTP user under which WordPress usually works cannot do anything for the time being.
I often have this problem on a test server (especially when upgrading plugins) and then have to clarify the ownership directly on the server (with SSH).
"chown -R ftp-user:ftp-group ./wp-content" (if you are in the same directory as wp-conent). Of course you have to use the correct names instead of ftp-user and ftp-group.
Before you do anything, first check the situation so that nothing breaks during your installation.
After changing the file permissions, it also worked for me!
Thank you!
1000 thanks and much more for these tips. At the edge of my personal despair, I have found the light in the dark here. THANK YOU!!!
Very good, thank you!
It was the file rights.
Hi,
I have now also gone through all the variants. The problem has been with me since the page move, but only with files with larger resolutions, from 3500px in width. At first I also thought it was the permissions, but since smaller files work, it all points to the memory limit, doesn't it?
According to the plugin I have 256mb - shouldn't eign. 3x enough? The hoster is 1&1, a relatively good package (Unlimited Plus). What do you think?
Thank you!
You mean with larger images? Then the maximum upload size will probably be limited to 8 MB or similar.
Hi, thanks for the quick reply. Well, strangely enough it's not about the file size but the resolution of the file. You can upload images with low resolution but 5mb memory without any problems. However, if I have one with e.g. 1mb BUT with a resolution greater than approx. 3500px, it remains hänngen. We have now defined an upload size of up to 125mb.
That must be due to the RAM, right? If WP can't cope with rendering larger resolutions?
You are right. Possible solutions:
That's all I can think of now.
Addendum for Strato customers
I recently had another problem on a Strato server. The problem was the spam filter, which sporadically prevented images from being uploaded to WordPress. You can deactivate it in the Strato customer center under the tab "Security" and "ServerSide Security". Now the upload should work flawlessly again.
Source:
http://www.markusbaumgartner.de/fehler-bei-bild-upload-in-wordpress/