0

I applied several different fixes. wordpressuser

$ sudo adduser wordpressuser www-data
$ sudo chown www-data:www-data -R /var/www/html
$ chmod 7777 -R /var/www/html
$ reboot
root # adduser www-data www-data

None of these worked and the person ran out of steps because no matter what I did, WordPress wouldn't let me update or install stuff without it asking for FTP access.

I have my static web site in the HTML folder, the WordPress in a directory called blog, and a podcast generator in a folder called podcasts.

Everything inside the html folder, including the html folder itself, has full read write and execute permissions under the user www-data and group www-data.

5
  • 1
    Wordpress doesn't know sftp, and the standard Wordpress update mechanism is over FTP. You can install an ftp server locally on the server and then configure Wordpress to point to that FTP server internally for its updates. This is what my Wordpress sites do.
    – Thomas Ward
    Dec 16, 2017 at 23:33
  • That chmod command created a gigantic security hole.
    – kasperd
    Dec 16, 2017 at 23:53
  • @kasperd Depends. If it's a dedicated box with one user, not really. If it's shared, yes. But having files writable by www-data means that any user, more or less, can execute commands as www-data, and overwrite at will...
    – vidarlo
    Dec 16, 2017 at 23:58
  • I got this message. How can I fix it? Plugin update failed. An error occurred while updating Stripe Payments: Could not remove the old plugin. Disabling Maintenance mode… All updates have been completed. Also, what kind of FTP server is easy to install? I tried Pure-FTP but I couldn't get it to work. when I tried logging in with FTP, Win sCP said the connection timed out. Dec 16, 2017 at 23:59
  • Check that the plugin directory is owned by the correct user with ls -l and try updating it manually.
    – vidarlo
    Dec 17, 2017 at 0:00

1 Answer 1

0

You have to add a direct update method to your wp-config.php file.

Edit wp-config.php, and add the line define('FS_METHOD','direct'); somewhere between <?php and ?>, for instance like this:

define('FS_METHOD','direct');

// Get everything else
require_once(ABSPATH.'wp-settings.php');
?>

This, combined with the permissions you have set will allow Wordpress to Update directly, without going trough FTP.

I tested this just now, and it appears to work. The directory has to be writeable for the www-data-user that's running Wordpress.

Source: https://www.hongkiat.com/blog/update-wordpress-without-ftp/

1
  • Thanks for this. It worked but then I got this message. Dec 16, 2017 at 23:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .