Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Got Wordpress working but getting error trying to install themes

After much tinkering, I finally got MySQL, phpMyAdmin, and Wordpress installed and working with Lion Server.


When I try to install a new Wordpress theme via the Wordpress admin (in my web browser) I get the following error:


Unable to create directory /Library/Server/Web/Data/Sites/CustomSitesDefault/mydomain/wp-content/uploads/2 011/09.


Is its parent directory writable by the server?


Can someone please tell me what I can do to fix this?


I assume that it is a permission related problem but so far I have not had any luck getting it to work.


Thanks.

Posted on Sep 1, 2011 2:18 AM

Reply
13 replies

Sep 1, 2011 8:27 AM in response to iHatePC

The error message kind of points you in the right direction - did you check the permissions on that directory? It needs to be writable by _www (the user that your web server runs at).


FWIW this is a oommon problem. WordPress is a nightmare to get running, especially if you care at all about site security.

Sep 1, 2011 4:31 PM in response to iHatePC

Do I need to change both the user and the group to _www ?

That depends on the privileges on the directory. Generally I'd set just the username.



Why don't the website folders that I create through the "server" application have the correct permission settings by default?


Define 'correct' please. Before you answer, bear in mind that the Server apps have no idea that you're running WordPress, just that you're creating a web site.

Also bear in mind, that as far as best practices are concerned, the 'correct' permissions for any directory accessible to the web server is read-only. There's generally no need for Apache to write to the filesystem, and allowing it to do so opens the door for hackers who might compromise your web server.


Given that, I'd say that the defaults (no write permission) are the correct permissions and that it's your use case (i.e. WordPress) that's making you jump through hoops.

Sep 1, 2011 8:01 PM in response to Camelot

I am new to running a web server and my expectation was that Lion server would create directories that Wordpress could write to without having to manually modify any of the permissions. This is how it works when I install an instance of Wordpress on my hosting company's server and I expected it to work in the same way on Lion.

Oct 15, 2011 9:06 PM in response to iHatePC

WordPress has no idea about web security. I'm appalled at how bad WordPress expects - no, requires - the file permissions to be. I'm surprised WordPress doesn't get exploited even more than it already does.


You should be grateful that Apple doesn't setup the web server to follow WordPress' 'security' model.


If you don't understand the basics of web server security then you are hanging your proverbial *** out in the wind asking some hacker to come along and take over your site for his wares.

Oct 15, 2011 9:12 PM in response to pointm

press command + I to get the info window and set the permissions to 777, that did it for me

This is just about as bad a set of permissions as you could have - unless you're a hacker, of course, in which case this is a dream come true.


Under ideal circumstances, the web server should be able to read but not write to the web content directory. You've just said everyone (and his dog) can both write to and execute any file in your web directory. That's asking for trouble. What's worse is that WordPress pretty much demands this, which means you really need to go out of your way to setup a secure WordPress installation.

Oct 16, 2011 6:42 AM in response to Camelot

Well answered Camelot, on the security issue of course you're right, what I forgot to mention is to set the permission back to default when done with the templates and themes. Can you explain how is this a security issue when is only the theme's folder and setting those permissions back to default? The root of WP, includes, admin, contents folders stayed default. I'm not an expert, but is there something I'm missing here?

Trying to learn a little more Camelot.

Oct 16, 2011 7:10 AM in response to Camelot

After reading your post for a second time, I see exactly your message. WordPress doesn't require change of permissions, themes and templates are custom additions to it, Permission changes is not to the content folder, but the themes's folder inside the content folder until you're done customizing, then back to default, and only in some instances.

He mentioned he had MySQL working on OS X Lion Server as a database, there is a reason why Lion Server uses PostgresSQL as database now instead of MySQL, PostgresSQL is more robust and of course more secure, it was also changed because Oracle bought MySQL (from what I heard). Found that out when setting up my WP blog at home, but decide to stick with MySQL and hosted somewhere else until WP implements or allow for PostgresSQL, it can be done but it needs a lot of heavy php code writing, not my fortè. You got me thinking on a couple of things, thanks Camelot, good points.

Oct 18, 2011 8:34 AM in response to pointm

Having Wordpress working and secure is possible.


There are different folders inside Wordpress directory that divide the "need to write" from the "need not to be writteable".


Mostly, the wp-content/ directory is the only one which needs write permissions.


There, Wordpress will store the uploaded images, themes, and plugins.


you'll see:


wp-content/plugins

wp-content/themes

wp-content/upload


In fact, in production sites where you are not going to mess up with themes and plugins, only the "upload images" folder need to have write permissions, which is normal and common need in all "social like" web sites.

Got Wordpress working but getting error trying to install themes

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.