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

  1. the total amount of memory that is released for the execution of the PHP programming language for your website (PHP memory limit),
  2. the memory available to the frontend of your WordPress website (WP memory limit),
  3. 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":

php_memory_limit
php_memory_limit

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.

wp_memory_limit
The two WP memory limits

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.

File permissions for the "uploads" directory

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.

For the recommendation:

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".


Heinz Duschanek
Heinz Duschanek

Heinz Duschanek founded the online marketing agency E-Werkstatt in 2003. Having previously worked in radio (Radio CD International, Ö1, Ö3), he is now particularly pleased with the direction that online marketing is taking. This gives him an excuse to buy lots of electrical devices and gadgets for audio and video.

Heinz is also interested in Tango Argentino (since 2009), Lindy Hop, Wing-Tsun, boxing and (jazz/blues) guitar.

21 Comments

  1. 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

  2. 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

  3. 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

  4. 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?

  5. 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.

  6. Thank you - good compilation of possible problems. Missing write permissions are probably the number 1 source of errors.

  7. @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.

  8. 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!!!

  9. 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!

  10. 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?

Leave a Reply

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