Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jul 16, 2011 12:29 am 
Offline
Senior Member

Joined: Fri Aug 20, 2010 3:12 am
Posts: 68
What are the correct permissions so WP doesn't ask for FTP credentials if installing plugin?

My nginx user is www-data. If I do su www-data I can create both file and directory.

But when installing plugin I am asked for FTP credentials.

I tried to give the public_html directory 777 permissions for a while to test if I can install plugin without providing FTP credentials but it didn't help either.

    WP 3.2.1
    nginx
    ubuntu


How can I install plugins without providing FTP credentials.


Top
   
 Post subject:
PostPosted: Sat Jul 16, 2011 2:20 am 
Offline
Junior Member

Joined: Wed Apr 06, 2011 8:20 am
Posts: 29
Try

Quote:
chown -R www-data /path/to/example.com/public


Works for me


Top
   
 Post subject:
PostPosted: Sat Jul 16, 2011 2:53 am 
Offline
Senior Member

Joined: Fri Aug 20, 2010 3:12 am
Posts: 68
Quote:
chown -R www-data /path/to/example.com/public


the owner is jarda and group is www-data. I believe it should work under such setup.


Top
   
 Post subject:
PostPosted: Sat Jul 16, 2011 11:17 am 
Offline
Senior Member

Joined: Mon Aug 31, 2009 2:33 pm
Posts: 78
Location: The OC
what user is php (assuming you're running php-fpm) running as? that's who needs write access to the files/folders.


Top
   
 Post subject:
PostPosted: Sat Jul 16, 2011 9:49 pm 
Offline
Senior Member

Joined: Fri Aug 20, 2010 3:12 am
Posts: 68
bjl wrote:
what user is php (assuming you're running php-fpm) running as? that's who needs write access to the files/folders.


I installed Nginx and PHP-FastCGI following http://library.linode.com/web-servers/n ... 0.04-lucid and there is in my config.

FASTCGI_USER=www-data

The user of public_html is jarda and the group for the directory and its subdirectories is either www-data or git. Both groups have the user www-data as a member.

Strange is that ever 777 of the whole public_html won't solve the problem....


Top
   
 Post subject:
PostPosted: Sun Jul 17, 2011 2:59 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
If memory serves wordpress needs to have it's files owned by the php user, even if it's writable if it's not the owner it won't go for it. a chown -R www-data /path/to/installation should fix it.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: works
PostPosted: Sun Jul 17, 2011 4:14 am 
Offline
Senior Member

Joined: Fri Aug 20, 2010 3:12 am
Posts: 68
obs wrote:
If memory serves wordpress needs to have it's files owned by the php user, even if it's writable if it's not the owner it won't go for it. a chown -R www-data /path/to/installation should fix it.


hm,

I have ssh jail for that public_hmtl directory so I didn't want to change the owner as I am not sure if the ssh jail will work. But I wanted to try what you said.

And you are right. The files must be owned by php user.

Thank you for your help

R


Top
   
 Post subject:
PostPosted: Sun Jul 17, 2011 1:59 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Just change them when you need to upgrade then change them back when done, that's what I do.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Jul 29, 2011 12:13 am 
Offline
Senior Newbie

Joined: Thu Jul 28, 2011 4:33 am
Posts: 10
Website: http://www.fangsoft.net
Change the group of all files/directories to www-data:

Code:
chgrp -R www-data wordpress/


Then change the permissions of all files to 664 and all directories to 775 (this gives www-data the same permission that you'd have).

Code:
find wordpress/ -type d -exec chmod 775 {} \;
find wordpress/ -type f -exec chmod 664 {} \;


And last, add this line to your wp-config.php:

Code:
define('FS_METHOD', 'direct');


Last edited by Fangs404 on Mon Aug 15, 2011 5:54 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Fri Jul 29, 2011 1:14 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Fangs404 wrote:
permissions of all files to 664 and all directories to 775 (this gives www-data the same permission that you'd have).

Code:
find wordpress/ -type d -exec chmod 755 {} \;
find wordpress/ -type f -exec chmod 644 {} \;

Typo alert. That code doesn't do what you say it does 8)

If www-data is already assigned as the group, chmod -R g+w /path/to/wordpress should work just fine.


Top
   
 Post subject:
PostPosted: Fri Jul 29, 2011 3:41 pm 
Offline
Senior Member

Joined: Sat Nov 13, 2010 3:05 am
Posts: 91
Website: http://www.graq.co.uk
If all else fails, you may need to tell WordPress it can do it:

Code:
/**
 * WordPress doesn't understand that PHP-FPM can write to disk.
 */
add_filter('filesystem_method', 'nginx_make_filesystem_direct');
function nginx_make_filesystem_direct() {
  return 'direct';
}


Top
   
 Post subject:
PostPosted: Mon Aug 15, 2011 5:55 pm 
Offline
Senior Newbie

Joined: Thu Jul 28, 2011 4:33 am
Posts: 10
Website: http://www.fangsoft.net
hybinet wrote:
Fangs404 wrote:
permissions of all files to 664 and all directories to 775 (this gives www-data the same permission that you'd have).

Code:
find wordpress/ -type d -exec chmod 755 {} \;
find wordpress/ -type f -exec chmod 644 {} \;

Typo alert. That code doesn't do what you say it does 8)

If www-data is already assigned as the group, chmod -R g+w /path/to/wordpress should work just fine.


Whoops! Fixed.


Top
   
 Post subject:
PostPosted: Fri Aug 26, 2011 3:14 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
There is a simple way round all of this and I just can't remember it :( I transferred my WP site across from shared hosting to an existing nginx Linode and made one tiny change and there was no need to worry about FTP. I think it was a one-liner chown or chmod or something like that. Chown I think for www-user?

Try googling it - I eventually found it and it was a hell of a lot easier typing one line than changing nginx or FTP. Chown -R something... sure it was...


Top
   
 Post subject:
PostPosted: Fri Aug 26, 2011 3:24 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
tentimes wrote:
There is a simple way round all of this and I just can't remember it :( I transferred my WP site across from shared hosting to an existing nginx Linode and made one tiny change and there was no need to worry about FTP. I think it was a one-liner chown or chmod or something like that. Chown I think for www-user?

Try googling it - I eventually found it and it was a hell of a lot easier typing one line than changing nginx or FTP. Chown -R something... sure it was...


Code:
chown -R www-data /path/to/wordpress

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Aug 27, 2011 3:38 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Is right :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group