5

It does appear that WordPress requires an FTP server to be installed to upload the files from the web interface. I have installed WordPress blog. I need to install some plugins but i m getting a box :--

  To perform the requested action, WordPress needs to access to your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Something like this:-- enter image description here

Can u help me?

Mohit Jain
  • 953
  • 2
  • 10
  • 15
  • WordPress does not require FTP, but the way to let it know that is very obscure. Check my answer for explicit info. – Abraham Vegh Jun 16 '13 at 01:19

4 Answers4

7

To install the VSFTP server on Ubuntu

sudo apt-get install vsftpd

Once you've got it installed you'll need to tweek the configuration, edit /etc/vsftpd.conf

Disable anonymous logins find the anonymous_enable directive and make it

anonymous_enable=NO

Enable local accounts to login set the local_enable directive to

local_enable=YES

Allow writes by setting the write_enable directive

write_enable=YES

Restart the ftp server so your changes take effect.

sudo service vsftpd restart

user9517
  • 114,104
  • 20
  • 206
  • 289
3

In order to enable the use of SSH2 for your updates and theme uploads, you have to generate your SSH keys and have the PHP SSH module installed. Then WordPress will detect that you have SSH2 available and you'll see a different option (SSH2) displayed when doing an upload/upgrade.

1.) Make sure you have the PHP module installed for debian it is:

sudo apt-get install libssh2-php

2.) Generate SSH keys, adding a passphrase is optional:

ssh-keygen
cd  ~/.ssh
cp id_rsa.pub authorized_keys

3.) Change the permission so that WordPress can access those keys:

cd ~
chmod 755 .ssh
chmod 644 .ssh/*

Now you'll get the SSH2 option when doing an upload/upgrade/plugin. Here is a pic, I don't have enough rep. to post an image. Here is a link to the image that you'll get, hopefully this is okay to include. https://www.dropbox.com/s/1m7fxlkp0nchplx/ssh-connection.png

4.) For added ease you can setup the defaults in your wp-config.php and this will pre-populate the SSH credentials in the WordPress upload window.

define('FTP_PUBKEY','/home/<user>/.ssh/id_rsa.pub');
define('FTP_PRIKEY','/home/<user>/.ssh/id_rsa');
define('FTP_USER','<user>');
define('FTP_PASS','passphrase');
define('FTP_HOST','domain.com');

The 'passphrase' is optional, if you don't setup a passphrase during ssh-kengen; then don't add it in wp-config.php

This solved my issue. And I didn't have to do the chown at all. But I have seen this method referenced in other places.

References:

JacquelineIO
  • 131
  • 3
2

Actually, you do not need a ftp server running on your server to solve this problem.

If you are running nginx, just simply go to /path/to/yout/wordpress/ and type this command in your SSH connection window:

chown -R www .

I'm not sure how to change user permission if you are running apache, change www to the apache group name like httpd may will work:

chown -R httpd .

Yeasiz
  • 21
  • 1
-2

Tell WordPress to use the filesystem directly — add this line to the top of your wp-config.php:

define('FS_METHOD', 'direct');
Abraham Vegh
  • 1,045
  • 5
  • 17
  • 26
  • 1
    Please don't just randomly throw 777 permission on folders without a need for it! http://codex.wordpress.org/Changing_File_Permissions#The_dangers_of_777 – faker Jun 16 '13 at 16:06
  • @faker I agree, but I also have no idea what the correct permissions for the OP’s environment’s web user would be, and given that it’s a Linode, s/he’s probably already root, so there’s no imminent harm. – Abraham Vegh Jun 17 '13 at 02:25
  • That explains the first 7 only, and that only partially. It's worth pointing out that this also marks the entire wp-content directory (including its contents) executable, in case someone wants to upload something nefarious. – Falcon Momot Jun 17 '13 at 08:25
  • I actually agree that `define('FS_METHOD', 'direct')` is the best way to solve this and it maybe would have worked without the chmod in the first place. – faker Jun 17 '13 at 08:31
  • 2
    Classic failure of Stack Overflow’s power model. Rather than suggest an edit for my answer (which has been accepted as the correct answer), a deluge of downvotes. The entire SE network is going to shit. – Abraham Vegh Jun 17 '13 at 13:54