What are permissions so WP doesn't ask for FTP credentials?
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</list>
How can I install plugins without providing FTP credentials.
14 Replies
> chown -R www-data /path/to/example.com/public
Works for me
> 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.
@bjl:
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
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….
@obs:
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
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).
find wordpress/ -type d -exec chmod 775 {} \;
find wordpress/ -type f -exec chmod 664 {} \;
And last, add this line to your wp-config.php:
define('FS_METHOD', 'direct');
@Fangs404:
permissions of all files to 664 and all directories to 775 (this gives www-data the same permission that you'd have).
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 does8)
If www-data is already assigned as the group, chmod -R g+w /path/to/wordpress should work just fine.
/**
* 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';
}
@hybinet:
@Fangs404:permissions of all files to 664 and all directories to 775 (this gives www-data the same permission that you'd have).
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 does8) If www-data is already assigned as the group, chmod -R g+w /path/to/wordpress should work just fine.
Whoops! Fixed.
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…
@tentimes:
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…
chown -R www-data /path/to/wordpress