0

After migrating a WordPress instance from one hoster to another, it's impossible to upload any media. Uploads fail with the message "Unable to create directory wp-content/uploads/2016/11. Is its parent directory writable by the server?". Also, WordPress tells me that the max file size is 2MB.

I've tried the following already:

  • Checking phpinfo(). Nothing suspicious there. phpinfo() tells me that max file size is 32MB.
  • Checking the owner and group for all directories and files.
  • Checking the permissions of files and dirctories. Even setting wp-content/uploads temporarily to 777 didn't help.
  • Making sure .htaccess is there and correct.
  • Creating a php script that creates the new directory manually, bypassing WordPress. Works like a charm. So php must be configured right.
  • Installing a fresh copy of WordPress in parallel and trying that version out. That works. Uploading media in the parallel installation works perfectly. Max file size is shown as 32MB.

When trying to upload media a couple of times, actually the directory gets created. However, no media gets uploaded and the error message stays the same. I've tried to upgrade to the newest version of WordPress in place. Strangely, the updater is able to download the newest archive and to extract it. However, it doesn't install.

Also now log file is create when I turn on the debugging options. As a WP noob, I'm pretty much in the dark. Any suggestions?

  • Is there an wp-content/uploads/2016 directory? You mentioned you changed the permssion for uploads, make sure that 2016 is set too. What does the httpd error log say? – user42826 Nov 4 '16 at 19:53
  • @user42826 Yes, the directory gets created by WordPress after a while. The permissions are set recursively. Unfortunately, I don't have access to the httpd log, as I'm using a hosted web environment. Not having an error log doesn't make things simpler :( – pchronz Nov 5 '16 at 7:41
  • please give www-data owner to uploads folder and permission of folder as 755 – Aftab Nov 5 '16 at 10:01
0

I have similar problem, even when I move folder from one subdomain to another on same server, migrated site require to be Uploads subfolder at least 775, on 755 doesn't work, I do know why but 775 helps.

  • Same dilemma! Your suggestion of changing the folder permission to 775 did allow my uploads to go through. However, this cannot be safe to leave it at that setting, correct? – flipflopmedia Oct 12 '18 at 14:04
0

Had the same issue, turns out it's because wordpress uses an upload path from the database which may not have been changed.

  1. Find the wp_options table and the upload_path option in particular
  2. Change the value of upload_path to your updated upload path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.