Wordpress Plugin Installation - Failed to connect to FTP Server - Safest Solution? Wordpress Plugin Installation - Failed to connect to FTP Server - Safest Solution? wordpress wordpress

Wordpress Plugin Installation - Failed to connect to FTP Server - Safest Solution?


I don't know if it is the safest method or not. But pasting this code in wp-config.php once solved my problem:

define('FS_METHOD', 'direct');


sudo chown -R www-data:www-data wp_site_rootsudo chmod -R g+rw wp_site_root

solved my problem.


Remember to set files and directories permission in this way:

chown -R www-data:www-data /var/wwwfind /var/www/ -type d -exec chmod 755 {} \;find /var/www/ -type f -exec chmod 644 {} \;