Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 1:19

4 Answers 4

up vote -3 down vote accepted

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

define('FS_METHOD', 'direct');
share|improve this answer
1  
Please don't just randomly throw 777 permission on folders without a need for it! codex.wordpress.org/… –  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 2: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 8: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 8: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

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

share|improve this answer
    
how to create users? and write_enable doesnt exsts... :-( u want me to make a entry for that? –  Mohit Jain Apr 2 '11 at 10:01
    
@MohitJain yes, also by default write_enable=YES should be in there, just commented. you should only need to un-comment it –  Beau Bouchard Apr 25 at 16:48

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 .

share|improve this answer
    
I am running apache and and i m getting this error:- chown: invalid user: `httpd' –  Mohit Jain Apr 3 '11 at 13:17
    
For Debian/Ubuntu it would be www-user –  mikegrb Apr 14 '11 at 2:01

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:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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