Home » Questions » Can I install/update wordpress plugins without providing ftp access?

Can I install/update wordpress plugins without providing ftp access?

0
1

I am using wordpress on my live server which only uses sftp using an ssh key.

I want to install and upgrade plugins, but it appears that you are required to enter your ftp login to install the plugins. Is there a way to install and upgrade plugins by manually uploading the files instead of having wordpress handle the entire process?

NOTE: This question was originally posted at StackOverflow.com by user77413

  • demo
    This is a test
  • You must to post comments
29
0

As stated before none of the perm fixes work anymore. You need to change the perms accordingly AND put the following in your wp-config.php:

define('FS_METHOD', 'direct');

NOTE: This answer was originally posted at StackOverflow.com by Ryan Wiancko

  • Martin
    Even though I had the correct permissions such that the web server could write to the plugins directory and wp-content directory, this setting fixed it so the admin did not prompt for the FTP/SFTP settings for updating plugins. Thank you. Worked perfectly.

    NOTE: This comment was originally posted at StackOverflow.com by Sean McCleary

  • Karen
    I had to explicitly do this as well.

    NOTE: This comment was originally posted at StackOverflow.com by julien_c

  • Albert
    When did they make this a requirement?

    NOTE: This comment was originally posted at StackOverflow.com by danjp

  • You must to post comments
6
0
  1. In wp-config.php add define(‘FS_METHOD’, ‘direct’);
  2. Make server writable the directories wp-content/, wp-content/plugins/
  3. Install the plugin.

Worked on version 3.2.1

NOTE: This answer was originally posted at StackOverflow.com by Lamy

  • You must to post comments
5
2

Usually you can just upload your plugin to the wp-content\plugins directory. if you dont have access to this directory via sftp I’m afraid you may be stuck.

NOTE: This answer was originally posted at StackOverflow.com by Toby Allen

  • You must to post comments
4
0

I also recommend the SSH SFTP Updater Support plugin. Just solved all my problems too…especially in regards to getting plugins to delete through the admin. Just install it in the usual way, and the next time you’re prompted by WordPress for FTP details, there’ll be extra fields for you to copy/paste your private SSH key or upload your PEM file.

Only problem I have is in getting it to remember the key (tried both methods). Don’t like the idea of having to find and enter it every time I need to delete a plugin. But at least it’s a solid fix for now.

NOTE: This answer was originally posted at StackOverflow.com by Mark Jeldi

  • You must to post comments
4
0

Resurrecting an old thread, but there’s a fantastic new plugin called SSH SFTP Updater Support that adds in SFTP capabilities without needing to edit your wp-config.php file. Also, Wordpress’s SFTP implementation relies on some somewhat obscure PHP modules that are often not enabled on servers; this plugin packages a different PHP SFTP plugin so you don’t have to configure anything on the Apache side.

I had run into tons of problems getting SFTP support to work – this plugin solved all of them and is just fantastic.

NOTE: This answer was originally posted at StackOverflow.com by canderson

  • You must to post comments
2
0

WordPress 2.7 lets you upload a zip file directly (there’s a link at the bottom of the plugins page) — no FTP access needed. This is a new feature in 2.7, and it works for plugins only (not themes yet).

NOTE: This answer was originally posted at StackOverflow.com by D. Lambert

  • Katharine
    BTW, upgrading is even easier -- you'll see an icon indicating that a new version is available, and you click "upgrade" and let it do its thing. Very nice. Even the WordPress core is upgraded this way - I went from 2.7 to 2.7.1 w/o uploading anything.

    NOTE: This comment was originally posted at StackOverflow.com by D. Lambert

  • Michele
    This is only true if you have the file permissions set so the web server / PHP user can write to them. If not, it will prompt you for FTP/SFTP credentials. See stereointeractive.com's answer.

    NOTE: This comment was originally posted at StackOverflow.com by Dave Forgac

  • You must to post comments
1
0

Try this

1) In the wp-config.php add define(‘FS_METHOD’, ‘direct’);

2) Set the “wp-content” directory to 777 for writable.

3) Now install the plugin.

NOTE: This answer was originally posted at StackOverflow.com by Mohan Raj

  • You must to post comments
1
0

The answer from stereointeractive covers all the options. Just wanted to mention an alternate way of using FTP. I’m guessing that the reason you are not allowing FTP access is for security. One way to address those security concerns is to run your FTP server listening only on 127.0.0.1

This allows you to use FTP from inside WordPress and you will be able to install plugins while not exposing it to the rest of the world. This can also be applied to other popular web applications such as Joomla! and Drupal. This is what we do with our BitNami appliances and cloud servers and works quite well.

NOTE: This answer was originally posted at StackOverflow.com by kaysa

  • You must to post comments
0
0

Wordpress will only prompt you for your FTP connection information while trying to install plugins or a wordpress update if it cannot write to /wp-content directly. Otherwise, if your web server has write access to the necessary files, it will take care of the updates and installation automatically. This method does not require you to have FTP/SFTP or SSH access, but it does require your to have specific file permissions set up on your webserver.

It will try various methods in order, and fall back on FTP if Direct and SSH methods are unavailable.

http://core.trac.wordpress.org/browser/tags/3.1/wp-admin/includes/file.php#L866

Wordpress will try to write a temporary file to your /wp-content directory. If this succeeds, it compares the ownership of the file with it’s own uid, and if there is a match it will allow you to use the ‘direct’ method of installing plugins, themes, or updates.

Now, if for some reason you do not want to rely on the automatic check for which filesystem method to use, you can define a constant, 'FS_METHOD' in your wp-config.php file that is either 'direct' 'ssh', 'ftpext' or 'ftpsockets' and it will use method. Keep in mind that if you set this to ‘direct’ but your web user (the username under which your webs server runs) does not have proper write permissions, you will receive an error.

In summary, if you do not want to (or you cannot) change permissions on wp-content so your web server has write permissions, then add this to your wp-config.php file:

define('FS_METHOD', 'direct');

NOTE: This answer was originally posted at StackOverflow.com by stereoscott

  • You must to post comments
0
0

If you’re on ubuntu, a quick solution that worked for me is giving ownership to the apache user (www-data by default) like so:

cd your_wordpress_directory
sudo chown -R www-data wp-content
sudo chmod -R 755 wp-content

NOTE: This answer was originally posted at StackOverflow.com by mikermcneil

  • You must to post comments
0
0

It is possible to use SFTP or SSH to auto update Plugins in WordPress, but you need to have ssh2 pecl extension. You can find out how to do it, using the following tutorial

NOTE: This answer was originally posted at StackOverflow.com by Sudar

  • You must to post comments
0
0

We use sftp w/ ssh (on both our dev and live servers) & have tried (not too hard though) to use the WP upload feature. I agree with Toby, upload your plugin(s) to the wp-content/plugins directory and then activate them from there.

NOTE: This answer was originally posted at StackOverflow.com by Schoffelman

  • You must to post comments
-1
0

Use the One Click Plugin Updater.

NOTE: This answer was originally posted at StackOverflow.com by laurentb

  • You must to post comments
Showing 13 results
Your Answer
Guest Author
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website
CAPTCHA*
Enter the characters shown on the image.