Software & Tech

WordPress "Unable to create directory" error on media upload

Holy crap that was frustrating… you get a short amount of time to work in the morning on a weekend cuz you’re a dad and you have loads of work to do before your wife takes off to be the best real estate agent all day and instead of writing and doing the good work you’re stuck with a GODDAM WORDPRESS UPLOAD ERROR!

xxxxxxxxxx has failed to upload due to an error Unable to create directory
Well, in my case, here’s what and why:

I had recently pulled down my /wp-content/uploads folder to run a killer image optimizer for mac on all the images (to optimize the images… that’s WHY!)

Then I used Transmit to push the newly optimized images back up to the server. Well, when you do this, your FTP app is likely to change the group and owner of those folders and files (in my case it went from apache’s default www-data to root (not sure why this happens).

I found this out after wasting most of my morning looking on this stupid goddam internet… so, in order to fix it you need to change the group AND owner of these files and folders back to whatever else the rest of your WP files are owned by. (note: you probably only need to change the owner, not the group, but thoroughness is thoughtful). To do this you’ll need to use the chown and chgrp commands.

That’s all i’ll tell you cuz i’m a doctor not a goddam poolman and I’m not going to be responsible for your chowning up your chrgp’n server.

Ok, for my own records, here’s what I did… don’t emulate this unless you know what ur doing!

    chown -R www-data /var/www/mydomain.com/html
    chgrp -R www-data /var/www/mydomain.com/html

    Leave a Comment

    Previous post:

    Next post: