I've ran into this issue where WordPress requests my FTP login credentials.

So far I've tried:

  • chown
  • change user
  • change file permissions
  • edited wp-config.php

None of it seems to work. The server I'm hosting it on is a VPS. I don't have much info from it. I am able to connect to my FTP using FileZilla but WordPress doesn't seem to be able to connect to it. Is there additional info I should request from my web host to properly set this up?


I haven't looked into httpd.conf yet. The owner of the public_html directory is root. I changed the permissions and owner to root. Is that the wrong practice?

I spoke to my server guy this morning, the server is listening to port 22 but on the hardware firewall, the public IP is nat from port 2232 to the server's port 22. But the server doesn't allow wordpress webui to enter 2232 (the port i'm using for SSH).

This is the additional bit I added to wp-config.php:

define( 'FTP_USER', 'root' );
define( 'FTP_PASS', 'ftp-password' );
define( 'FTP_HOST', '' );
  • Are you facing the problem when you try to install new themes and plugins? If yes then contacting your hosting provider and ask them to solve this issue
    – bagpipper
    Jun 28, 2016 at 10:37
  • 1
    Have you tried changing the user and group, then setting the permissions? This sounds more like a server level problem than a WordPress problem. Can you verify that PHP can write to those folders when loaded via the browser? Write a test file that when ran creates a helloworld.txt and puts "lorem ipsum" inside. If it works it's a WordPress problem. If it doesn't then it's a server/hosting problem and this isn't the appropriate place to ask
    – Tom J Nowell
    Jun 28, 2016 at 10:44
  • Can you post what have you edited in wp-config.php and others ?
    – bravokeyl
    Jun 28, 2016 at 10:45
  • 1
    Potential workaround - setting FS_METHOD to 'direct' in your wp-config. Note: not a full workaround, don't leave it there forever. See the docs here
    – Tim Malone
    Jun 28, 2016 at 10:46
  • When you say that you've Chowned and CHMOD'ed the files. What did you do exactly. To whom and to what did you change the ownership and permissions to?
    – Howard E
    Jun 28, 2016 at 14:05

2 Answers 2


Guess it needs to be said first - it is a bad idea in general to just let anyone that succeeded to trick you into uploading his PHP onto your server to actually be able to write to your code directories. It is double problematic if you let him access to your root credentials and write to anywhere on your server.

That said, it sounds like you just don't have an FTP server installed on your server. SFTP is different from FTP and being able to access via one do not ensure access with the other.

You should login to your server, run an FTP command with the credentials you put in the wp-config to first make sure you can connect and access the relevant directories. Once you can properly connect woth the FTP command on your server you can use the same credentials in your config.

  • So the solution here is to install a "ftp service" in my VPS, provide wordpress a different username/password for the ftp and allow it to read/write to the server?
    – fupuchu
    Jun 29, 2016 at 9:28
  • As said in the prefix, I don't like the idea at all as IMO the security risk doesn't worth the time you save. If you do want it, then FTP is probably the wrong way to go about it and you should check that the file permissions to the WP directories are such that enable the web server user to write to them. If you do go with the FTP option, at least configure it to respect only requests coming from the local host, configure a special user for that and restrict its access to whatever is below the WP root directory Jun 29, 2016 at 10:27

1) The first thing you have to do is to open the wp-config.php file from your WORDPRESS root folder.(wordpress/wp-config.php).

2) Paste the below code to your wp-config.php just below every other line of code.

  • 2
    How does this differ from the other answer by baconi. Also, as I have already commented on the answer by @baconi, why would this solve the issue Jun 29, 2016 at 7:37

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