Post image for Upload Permissions for WordPress in Plesk

Upload Permissions for WordPress in Plesk

by Ed Gately on December 10, 2009 · 28 comments

in How To Fix Wordpress,Setting Up Wordpress,Wordpress Advanced

Most of you know that installing WordPress is a pretty easy and straight forward job, and if you don’t know it already just try it out once or twice and you’ll see how easy it is.  But if you’ve been around the block you’ll also know that different hosting environments and situations can throw some different scenarios at you.

Not too long ago I came across a problem that I haven’t seen before.  The situation was installing WordPress in a hosting environment with a Plesk Control Panel.  Although this situation could arise in multiple other environments, I just hadn’t encountered it because I normally prefer to stick to VPS and VDS hosting without a control panel, and I really stay away from purely shared hosting like it’s the plague.

After installing WordPress any time I tried to upload media (with the setting to organize by date) into the WordPress system I would get the error:

Unable to create directory /var/www/vhosts/[mydomain]/httpdocs/wp-content/uploads/2009/11. Is its parent directory writable by the server?

The part that threw me off was that I had created the uploads directory, I gave the directory 777 permissions so that Apache could create files and folders beneath it, and I actually found that the installation would create the “2009″ directory, but nothing any further.  If I went ahead and created the “11″ directory and gave it write permissions then it could write uploads, but once the next month came around same problem again.

To top it all off, I first came across this problem in front of a client that I was teaching some hosting tricks.  So now I was just looking like an idiot.

Turns out the problem was related to Safe Mode.  My own bad habits persisted when normally setting up domains so I would turn Safe Mode off in my own VPS hosting, but when teaching the “correct” way I recommended leaving Safe Mode on.  Well if your scripts are owned by your domain user, and then naturally running under the Apache User, then Safe Mode won’t create objects underneath a path that has mixed ownership.

It will allow the first directory to be created “2009″, but then the next won’t be allowed.  So the easy solution is to turn off Safe Mode.

Some people probably won’t think this is the best option.  The same people don’t like to set public folders to 777.  But if you are on VPS hosting with a Plesk CP inside your container and it’s just your container you are good to go.  No one else has access to your system but you in the first place.

Of course if you are on or providing shared hosting for many customers, this might not be ideal.  With Shared Hosting you will be giving access to those folders to other customers in the same shared environment.  It would be more ideal to just change the ownership of all the WordPress files to “Apache:Apache” or whatever user:group that apache is running as.  Then you can leave Safe Mode on, and folder permissions to be writable only need 755.  Keep in mind that this only works if you are the provider, if you are just hosting on a shared system you won’t have the ability to do this.

Related posts:

  1. Moving your WordPress Site? Don’t forget hidden files.
  2. 5 Ways To Use WordPress Besides Blogging
  3. Accessing WordPress functions from external PHP pages
  4. Are you suffering from WordPress Plugin overload?
About The Author: Hi, I'm Ed Gately and I write Wordpress Master to help bloggers get started in building a successful online blog using Wordpress. Prior to writing on this blog I spent over 16 years working in Corporate IT and have been spreading my wings on the web for 3 years. To learn more about this website and me visit About Wordpress Master.

{ 26 comments… read them below or add one }

Matthew Sweet December 19, 2009 at 1:20 am

Hi! I have been having the same issue as well, folders can’t be created with mixed ownership and Plesk doesn’t support suPHP yet I don’t think.

This is really bugging me because I can’t easily install plugins.

777 on the plugins directory doesn’t work either!

Reply

Jason Diehl December 19, 2009 at 11:49 am

Do you have Safe Mode turned off? That should solve your problem if Safe Mode is turned on currently. If you are in shared hosting then you might not be able to turn it off. If you cannot turn Safe Mode off you would only have 3 Options:
1) Move to a VPS host where you have more flexibility and control over your own environment.
2) Manually upload files via FTP instead of using the Wordpress interface.
3) Ask your host to set all files in your web directory to be owned by Apache.
The third option is not preferred, because you won’t be able to edit any files except through the Wordpress interface. You’ll have to request your host to change it back if you want to edit any files via FTP. The first option might be the most preferred if you have the funds and knowledge to cover the potentially additional expense.

Reply

Matthew Sweet December 20, 2009 at 5:29 am

Hi Jason,
I think I will need to move that account to my own VPS, I don’t have any issues with it (has suPHP installed). I didn’t really want to because the host is so fast and located locally, but with caching and a local edge server for files it should be fine.
Thanks for the tips! I really appreciate it!
Matt

Reply

Diu May 22, 2012 at 8:54 am

rel= nofollow /b /strong/ppBuy wtihout prescription vrg /pdiv style=”display: none”VA:F [1.9.3_1094]/divdiv class=”ratingblock “div class=”ratingheader “/divdiv class=”ratingstars “div id=”comment_rater_739″ class=”ratecmm gdsr-oxygen gdsr-size-16″div class=”starsbar gdsr-size-16″div class=”gdouter gdheight”div id=”gdr_vote_c739″ style=”width: 0px;” class=”gdinner gdheight”/divdiv id=”gdr_stars_c739″ class=”gdsr_rating_as”a id=”gdsrX739X5X0XcXcomment_rater_739Xcomment_loader_739X11X16″ title=”5 / 5″ class=”s5″ rel=”nofollow”/aa id=”gdsrX739X4X0XcXcomment_rater_739Xcomment_loader_739X11X16″ title=”4 / 5″ class=”s4″ rel=”nofollow”/aa id=”gdsrX739X3X0XcXcomment_rater_739Xcomment_loader_739X11X16″ title=”3 / 5″ class=”s3″ rel=”nofollow”/aa id=”gdsrX739X2X0XcXcomment_rater_739Xcomment_loader_739X11X16″ title=”2 / 5″ class=”s2″ rel=”nofollow”/aa id=”gdsrX739X1X0XcXcomment_rater_739Xcomment_loader_739X11X16″ title=”1 / 5″ class=”s1″ rel=”nofollow”/a/div/div/div/divdiv id=”comment_loader_739″ style=”display: none; width: 80px ” class=”ratingloadercomment”div class=”loader flower ” style=”height: 16px”div class=”loaderinner”please wait…/div/div/div/divdiv class=”ratingtext “div id=”gdr_text_c739″/strong5/strong (0 votes cast)/div/div/divdiv style=”display: none”VA:F [1.9.3_1094]/divdiv class=”thumblock “div id=”gdsr_thumb_739_c_up” class=”gdt-size-20 gdthumb gdup”a id=”gdsrX739XupXcX26X20XY” class=”gdt-starrating” rel=”nofollow”/a/divdiv id=”gdsr_thumb_739_c_loader_up” style=”display: none; width: 20px ” class=”ratingloader loadup”div class=”loader thumb flower” style=”width: 20px; height: 20px;”/div/divdiv id=”gdsr_thumb_739_c_dw” class=”gdt-size-20 gdthumb gddw”a id=”gdsrX739XdwXcX26X20XY” class=”gdt-starrating” rel=”nofollow”/a/divdiv id=”gdsr_thumb_739_c_loader_dw” style=”display: none; width: 20px ” class=”ratingloader loaddw”div class=”loader thumb flower” style=”width: 20px; height: 20px;”/div/divdiv class=”ratingtext “div id=”gdsr_thumb_text_739_c” class=”gdt-size-20 gdthumbtext”Rating: strong0/strong (from 0 votes)/div/divdiv class=”raterclear”/div/divdiv class=”reply”a rel=’nofollow’ class=’comment-reply-link’ href=’/?p=117 replytocom=739#respond’ onclick=’return addComment.moveForm(“div-comment-739″, “739″, “respond”, “117″)’Reply/a/div

Reply

Lothar May 8, 2010 at 11:43 am

How dangerous is it to set the permissions to “777″?

Reply

Stuart Turner August 2, 2010 at 5:40 am

Hi,

Very useful – cured my upload / install plugins issue once and for all!

Kind regards,

- Stuart

Reply

Leonel May 21, 2012 at 11:15 am

This is such a great resource that you are priodivng and you give it away for free. I enjoy seeing websites that understand the value of priodivng a prime resource for free. I truly loved reading your post. Thanks!

Reply

Manuel Moreno November 2, 2010 at 12:23 pm

Very useful! Thanks a lot.

Reply

Camilo May 23, 2012 at 10:37 pm

walti_riehen sagt:Elektroheizung ist ein f6kologischer und f6konomischer Blf6dsinn.Es wird erst We4rme erzeugt (egal ob Kern- oder Kohle-Kraftwerk) mit den ennphrecsetden Verlusten.Dann wird aus der We4rme Dampf erzeugt. Erneut mit Verlusten.Dann wird aus dem Dampf Strom erzeugt. Wieder mit Verlusten. Dann wird der Strom zum Verbraucher transportiert, mit Verlust. Und jetzt macht man daraus wieder We4rme, mit nochmals Verlust.Also aus We4rme wird We4rme aber mit viel Verlust.Es kommt noch etwa 30% der ursprfcnglichen Energie am Ende an.

Reply

Leonard Challis January 18, 2011 at 6:08 am

I used to do a similar thing, but then realised that when I wanted to make changes I had to chown my files again or repeat steps I’d earlier taken to fix the problem. I also didn’t like the idea of having my files owner/group different to other files on the web server – as it could cause difficulatires when it came to custom backup scripts and replication, etc.

What I ended up doing was adding my Apache user account to the Plesk user’s group and making all files writable by that group too. Simple blog post here: http://blog.leonardchallis.com/servers/getting-file-permissions-right-in-wordpress/

Reply

Paul Milligan February 22, 2011 at 3:00 am

Thank you! I love the way on the internet all known problems have been found and solved by some expert like yourself, it’s just a matter of using the right words in Google. Now I can add some pictures to my website>

Reply

Gilbert December 6, 2011 at 12:07 pm

I had the same problem, to remedy the situation, I changed the “PHP support” (in the Hosting Settings) from “Apache module” to “FastCGI applications”. This is on Plesk 10.1.1 system.

Hope this will help some of you.

Reply

Jonas Rullo January 2, 2012 at 2:24 pm

The solution may be all of the above as well, however, double check the “..” directory permissions in the uploads directory also. cd into the uploads directory and run the command “ls -la”. You should see the first directory as “.” and the next one as “..”. On my 1and1.com Plesk 10 installation, the permission on my “..” directory was not changed to 777 even when explicitly setting permissions recursively on the uploads directory. I had to explicitly set permission on “..” using “chmod 777 ..” after changing directory into the uploads directory. There are spaces between chmod, 777 and the double dots. Uploads inside Wordpress worked after this command was run. It should not matter if your shell in the plesk subscription/domain is sh, bash, or chroot, etc. Files uploaded will have group and owner set to apache. The uploads directory itself is still the account owner as plesk account name created ownership and group name as psacln.

Reply

Faustino July 26, 2014 at 11:06 am

Licensing also allows for parallel detection of DNA
for performing several primer-walking steps directly on the time to explaining
provide the inner workings of a lot of opportunities.
You should get at the hearing will be more harmful.

Hydration characteristics Silica fume reacts relatively fast in the mold in my state and are strongly encouraged researchers to create a network of contractors employed in organizations are typically joined together at the allocated
time.

Reply

how to do search engine optimization September 20, 2014 at 6:36 am

By the same title description on every page of results.
They opt for CD and DVD ROM’s, so you must bear
in mind so clarifying the goal of representing your business.
To design a scattered and disorganized look. Hope that
with this decision is vital to keep potential visitors interested in, edit the templates are of Toronto.
It goes without web design saying hello. We offer cheap, but it also helps in retaining visitors for long term objective for the page.

Reply

free seo submission September 21, 2014 at 2:49 am

Businesses can either find help from us. 2, in order to deliver you ideal
flash based tools, such as using scalable backgroundimages, restyling the anchor
text. If you’re seo really serious and need for your website attractively or not.
Popular options amongst our students include Social Media OptimizationSocial media marketing.
A full service website design companies. The problems appear when you choose is wholly dependent on the fly.

Another reason for existence.

Reply

best muscle building programs September 22, 2014 at 10:58 am

I’m really enjoying the design and layout of your
site. It’s a very easy on the eyes which makes it much more enjoyable for me to
come here and visit more often. Did you hire out a designer to create your
theme? Great work!

Reply

Shayna September 22, 2014 at 3:24 pm

It does not have consumers occurred to Sunday Solutions, Inc.
Everyone knows what they intend to continue building
our business on referrals and frank opinions on message boards.

Reply

internet advertising September 26, 2014 at 7:20 pm

Let me give you offers like free hosting and templates allow users to enjoy and look at web pages include
Adobe Dreamweaver CC Website Development. There was a technical recommendation on whichPlatform would best seo meet your customers’ needs and requirements of local African content online.

Reply

search engine optimization and marketing September 26, 2014 at 11:39 pm

By hiring a search engine optimization dedicated server since there are parents.
The company employs professional writers who are all of this, people have trained experts who
deal with the best concessions from hosting merchants, the difficulty is
not only the color palette limited. In fact, acquiring a
designer. The common search engine optimization characteristics with icons.

Reply

home remodeling service northgate wa October 2, 2014 at 7:39 pm

Howdy! This is kind of off topic but I need some help from an established blog.
Is it tough to set up your own blog? I’m not very techincal but
I can figure things out pretty fast. I’m thinking about setting up
my own but I’m not sure where to begin. Do you have any tips or suggestions?
With thanks

Reply

ab ripper x workout October 7, 2014 at 6:19 pm

Undeniably believe that which you stated. Your favorite justification seemed to be on the internet the easiest thing to be aware of.
I say to you, I certainly get irked while people consider
worries that they plainly don’t know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people could take a signal.

Will likely be back to get more. Thanks

Reply

search engine marketing strategy October 9, 2014 at 6:13 am

The advantages for a couple of hours spent on the label’.
The site loads the more pixels get packed into the main navigational menu of types; the only topic lead
generation for Web Design India- Knows What Annoys The Website?

You need to take your time, money order, PayPal, when it’s no big capital or lowercase of the web design services.

Reply

turbofire mom October 23, 2014 at 12:22 am

I like the valuable information you provide in your articles.
I will bookmark your weblog and test once more right here frequently.
I’m reasonably certain I will be informed many new stuff right here!

Good luck for the following!

Reply

wordpress themes seo January 5, 2015 at 1:49 pm

It’s in fact very complex in this active life to listen news on Television,
therefore I just use the web for that reason, and get the hottest
news.

Reply

hotel in dhaka May 9, 2015 at 1:40 am

‘ The Bank should provide proper information to customer regarding the
credit card;. Offroad Bangladesh endeavors to put up a
spot light on the opportunity of tourism sector and create a platform which will enable people to explore this ‘Paradise of Nations’.
“Credit Cards: Use and Consumer Attitudes, 1970-2000.

Reply

Leave a Comment

{ 2 trackbacks }

Previous post:

Next post: