I have an issue i've been trying to fix for two days now. I've searched the web and tried to apply multiple suggestions from other posters.

So i have a self hosting web server: CentOS7, Apache, PHP, MariaDB, OpenSSH and Pure-FTPd.

I found a nice guide combining MariaDB and pure-FTPd. I used vsftp beforehand but later found the use of database to store valid FTP users more robust and convenient.

So, I've successfully set-up ftp server and logged in with FileZilla from a remote client. I also managed to copy files and create folder in "wp-content" folder of wordpress. However when i try to use WordPress's in-house FTP solution i get a "Failed to connect to FTP Server" error. I managed to upload plugins using:

define('FSMETHOD', 'direct');

option in wp-config.php file. That worked and plugin was successfully installed. However i read that this is not a safe option. I am aware that plane FTP is not the safe way as well but i wanna make that work first before moving to FTPS variant.

I also tried pasting this block in wp-config.php (pre-filled FTP data basically):

define('FS_METHOD', 'ftpext');
define('FTP_BASE', '/path/to/wordpress/'); 
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'ftp.example.org');
define('FTP_SSL', false);

But that also didn't work.

Tl.dr.: FTP works fine with FileZilla (can connect to server and see wp folder) however using WP in-house ftp solution gives an error.

I tried all folders setting ownership "apache:apache" as well as myUser:myGroup (Apache being part of my group). WordPress permissions:

find /var/www/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;

as well as

find /var/www/ -type d -exec chmod 775 {} \;
find /var/www/ -type f -exec chmod 664 {} \;

Nothing worked. I am really running out of ideas here.

enter image description here

  • I would retry setting the owner/group permissions as this is usally what makes the FTP dialogue come up: chown -R user:group /path/to/wordpress/ ... otherwise look into request_filesystem_credentials function to debug what test is actually failing and preventing direct writing.
    – majick
    Mar 17, 2019 at 5:20
  • Set up a virtual host for your local WordPress installation and use it as "Hostname' for inner FTP. Configure vsftpd which never delivers a problem.
    – Max Yudin
    Mar 17, 2019 at 5:22
  • solution link for future reference... davidegan.me/install-wordpress-plugins-localhost-linux-mint Sep 13, 2019 at 13:49

1 Answer 1


After two days of head banging, found out it's the SELinux giving me the issues.

Usually i got a message from it saying what and why was blocked, provided with a command to enable the action that SELinux was preventing. Like when apache wasn't able to write logs to my virtual host folder... This time around i got no such message so it didn't cross my mind it was SELinux-s fault.

I ended up turning SELinux off altogether as i saw CPannel doesn't function with it being enabled (i intend to use CPannel or smth equivalent down the line).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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