0

I installed WP using WP-CLI (i.e. on the command line on the remote server). I'd like to give another person the ability to change the theme, plugins, etc. using the standard WP admin browser interface. When she (and I) try to install a new theme from an account with admin permissions, we are presented with the "Enter FTP credentials" screen. Some searching online suggests that there are issues with my file permissions. I suspect this has to do with the particulars of the WP-CLI install as I have not modified any files or permissions manually.

So, my question is: Is what I'm asking for even possible? If so, what do I need to change? (File permissions, wp-cli configuration, something else?)

Thanks for any suggestions you can give, and I'm happy to provide more details if necessary.

The output of ls -l right now is

-rw-rw-r--   1 242318  242318      0 Nov 13 08:42 favicon.ico
-rw-rw-r--   1 242318  242318    418 Nov 13 08:02 index.php
-rw-rw-r--   1 242318  242318  19930 Nov 13 08:02 license.txt
-rw-rw-r--   1 242318  242318   7360 Nov 13 08:02 readme.c30af37e546921a14e3c4909651671ac.html
-rw-rw-r--   1 242318  242318      0 Nov 13 08:42 robots.txt
-rw-rw-r--   1 242318  242318   4951 Nov 13 08:02 wp-activate.php
drwxrwxr-x   9 242318  242318     88 Nov 13 08:02 wp-admin
-rw-rw-r--   1 242318  242318    271 Nov 13 08:02 wp-blog-header.php
-rw-rw-r--   1 242318  242318   5007 Nov 13 08:02 wp-comments-post.php
-rw-rw-r--   1 242318  242318   2764 Nov 13 08:02 wp-config-sample.php
-rw-r--r--   1 242318  242318   1567 Nov 18 23:52 wp-config.php
drwxrw-r-x   6 242318  242318      8 Nov 13 09:48 wp-content
-rw-rw-r--   1 242318  242318   3286 Nov 13 08:02 wp-cron.php
drwxrwxr-x  12 242318  242318    126 Nov 13 08:02 wp-includes
-rw-rw-r--   1 242318  242318   2380 Nov 13 08:02 wp-links-opml.php
-rw-rw-r--   1 242318  242318   3123 Nov 13 08:02 wp-load.php
-rw-rw-r--   1 242318  242318  34669 Nov 13 08:02 wp-login.php
-rw-rw-r--   1 242318  242318   8252 Nov 13 08:02 wp-mail.php
-rw-rw-r--   1 242318  242318  11062 Nov 13 08:02 wp-settings.php
-rw-rw-r--   1 242318  242318  25124 Nov 13 08:02 wp-signup.php
-rw-rw-r--   1 242318  242318   4035 Nov 13 08:02 wp-trackback.php
-rw-------   1 242318  242318   3055 Nov 13 08:02 xmlrpc.php

1 Answer 1

1

Wordpress can't write files directly most probably because user which runs PHP interpreter don't have permission to write. Correct answer depends on what is your environment - if you are on shared hosting probably you can't do anything about it and the only option is to set FTP credentials on wp-config.php so you won't need to enter it all the time. Look on codex

define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp.example.org' );

If you have root control over your system you can change file owner to user which runs PHP interpreter but this can be dangerous if you run more than one site on this server. If this is the case you probably should configure environment where every site has one user in the system which own the files of this particular site and run them with this user privileges. You can do this for example with application pools if you are using php-fpm or with suPHP.

You can check if this is the case by temporarily change files owner to user which runs PHP interpreter. If you use Apache server with mod_php it will probably be www-data user.

2
  • How would I determine which user is running the PHP interpreter?
    – Sam
    Commented Nov 19, 2015 at 1:25
  • Try one of methods provided here. If you're on linux probably you can just create php file with one line of code, and visit this through web browser. echo exec('whoami'); Commented Nov 19, 2015 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.