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
- Russell asked 16 years ago
-
This is a test
- You must login to post comments
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
- Deborah answered 13 years ago
- last edited 13 years ago
-
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
-
I had to explicitly do this as well.
NOTE: This comment was originally posted at StackOverflow.com by julien_c
-
When did they make this a requirement?
NOTE: This comment was originally posted at StackOverflow.com by danjp
- You must login to post comments
- In wp-config.php add define(‘FS_METHOD’, ‘direct’);
- Make server writable the directories wp-content/, wp-content/plugins/
- Install the plugin.
Worked on version 3.2.1
NOTE: This answer was originally posted at StackOverflow.com by Lamy
- Rita answered 13 years ago
- last edited 12 years ago
- You must login to post comments
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
- Cindy answered 16 years ago
-
Yep, just drop 'em in wp-content/plugins.
NOTE: This comment was originally posted at StackOverflow.com by ceejayoz
- You must login to post comments
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
- Glenn answered 13 years ago
- You must login to post comments
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
- Teresa answered 13 years ago
- You must login to post comments
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 answered 16 years ago
-
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
-
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 login to post comments
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
- Vickie answered 12 years ago
- last edited 12 years ago
- You must login to post comments
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
- Tracy answered 13 years ago
- You must login to post comments
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
- George answered 14 years ago
- last edited 12 years ago
-
A link to a resource explaining which permissions are necessary would make this answer even more useful.
NOTE: This comment was originally posted at StackOverflow.com by Jörn Zaefferer
-
I had to do: sudo chown -R www-data wp-content as well as granting write permissions
NOTE: This comment was originally posted at StackOverflow.com by mikermcneil
-
Worked for me using define('FS_METHOD', 'direct'); in wp-config.php. Of course, after setting correct file permissions. Thanks.
NOTE: This comment was originally posted at StackOverflow.com by Meglio
-
The use of
getmyuid
on line 876 is arguably incorrect here, as it returns the UID of the script owner, not the script executor. I believe it should beposix_getuid
.NOTE: This comment was originally posted at StackOverflow.com by cbuckley
-
Yep: core.trac.wordpress.org/ticket/10205
NOTE: This comment was originally posted at StackOverflow.com by cbuckley
- You must login to post comments
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
- Tracy answered 13 years ago
-
Don't give execute permission to files that don't need it.
NOTE: This comment was originally posted at StackOverflow.com by Burhan Ali
- You must login to post comments
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
- Allen answered 15 years ago
- You must login to post comments
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
- Joyce answered 16 years ago
- You must login to post comments
Use the One Click Plugin Updater.
NOTE: This answer was originally posted at StackOverflow.com by laurentb
- Theresa answered 16 years ago
- You must login to post comments