WordPress Media Library: Upload error

Posted in: Technology | Tags: , ,

Running WordPress on a dedicated server is sometimes a tricky job, due to some server adjustments that need to be made. The most significant is the upload error we get, when we try to upload a media file from the WordPress administration panel.

Usually the error message we get is something like this:

“Unable to create directory /wp-content/uploads/ Is its parent directory writable by the server?”

My first thought on that was to change the permissions on the uploads folder.

Easy huh ? Well apparently not.
The error message continued to appear.

So i tried a search to find a reasonable solution about my uploading problem. Unfortunately i couldn’t find one complete answer and it was sad to see that there is no official documentation from WordPress about the correct setup of a dedicated server.

However I tried to combine some suggestions from here and there.
Well it appears that this is NOT a permission’s problem. It is an ownership problem of the target folder (currently uploads). So we have to set root as the owner and the group

The solution is simple but we need shell access to our server and a  little experience in dealing with command line ;)

  1. First we have to login to our server using a client like Putty (in windows) or Terminal (in OSX).
  2. Then we “navigate” into our desired domain, into the parent folder, where our target folder for uploads exists.
  3. Here, by typing ls -l, we can see the owner and the group, this folder belong to.
  4. Type chown root uploads/ in order to make root, the owner of the folder
  5. Then type chgrp root uploads/ in order to change the group also, to root.

Your uploads folder is ready. Very simple but for the most users of wordpress, who have little experience on server setup, quite tricky.


Responsiveness

The past year we introduced a service, were you send us your PSD file and we turn it into a fully responsive HTML5 website.

After a successful year, we are reworking this service, to make your experience better. Let's talk about your new idea!

learn more >