December 4, 2014 at 11:06 pm | web, Wordpress.

If you are self hosting a WordPress blog install at some point you have run into a problem with permission or know someone who has.

Mostly it surrounds the uploads folder for your media. The internet is filled with threads about the problem. Do yourself a favor and don’t do as some people suggest and set the folder permission to 777 to fix the problem.

The first problem might be that the apache user that WordPress uses to create folders does not have permission to create the new folders. Usually the user is part of the www-data group. But not always. If you have the correct permissions you can update the owner of your uploads folder and subdirectories. su to the root user or use sudo on the commands.

Set ownership of uploads folders except .svn folders.
find /path/to/uploads ! -iregex .*\.svn.* | xargs chown -v webmaster:www-data

Next lets update any folder permissions in the uploads folder. Minus folders you don’t want to change. In this case .svn folders.

find /path/to/uploads ! -iregex .*\.svn.* -type d | xargs chmod -v 775

Now lets correct any permission problems with files in the uploads folders. Same thing with folder you don’t want to change like .svn

find /path/to/uploads ! -iregex .*\.svn.* -type f | xargs chmod -v 664