Hi,
I'm a rookie drupal explorer and trying to get a hang of it by video tutorials. Everything works fine untill i want to install/upload a them or module.
I guess this question has been asked before but i couldn't find the answer to my problem.
Here is the complete Message:
Failed to connect to the server. The server reports the following message:
Cannot connect to FTP Server, check settings

For more help installing or updating code on your server, see the handbook.
WARNING: You are not using an encrypted connection, so your password will be sent in plain text. Learn more.
To continue, provide your server connection details

Connection method
FTP ( i have a sFTP connection but i can't choose it and i don't know if it matters)

Username:
I tried my drupal details, the server details and the database details but all of them result in zero upload or confirmation
Password

Your password is not saved in the database and is only used to establish a connection.

ADVANCED SETTINGS
Host:
localhost

Port:
21 (i have tried 22 and 3306 also)

The connection will be created between your web server and the machine hosting the web server files. In the vast majority of cases, this will be the same machine, and "localhost" is correct.
Port.

I can answer to some technical questions but i'm still a rookie.
Some help please ?

Comments

Yoshimo’s picture

Apperantly when i upload the files by my ftpclient there is no problem. But when i want to upload the files trought drupal it give me an error message :s

ravis’s picture

Are you uploading files using any FTP client??

Try FileZilal FTP client with following settings:
-------------------------------------------
Username: Your web hosting username. Same as cPanel username.
Password: your web hosting login password.
Server: domain.com
Port: 21
---------------------------------------------

Upload theme folder in:
sites/all/themes

I work at Drupar.com

shazi’s picture

Hi,

I'm running website at localhost... and my website full address is .. http://localhost/linuxfolk/ means im getting my new drupal site by going to this address...

As I'm new to drupal and trying to upload theme but its gives ftp connection error..

username = of website (suppose Admin )
password = of website (and admin password)
Server = localhost/linuxfolk
port = 21

i'm geeting error ...
# Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in FileTransferFTPExtension->connect() (line 54 of /var/www/linuxfolk/includes/filetransfer/ftp.inc).
# Failed to connect to the server. The server reports the following message:

Cannot connect to FTP Server, check settings

Can you help me I don't know what is wrong as i'm running site in localhost..

thanks in advance...

ravis’s picture

what software you are using for local server like XAMPP, WAMP etc??

On localhost, FTP will not work.
you need to copy paste theme folder on your local computer like:
c:/wamp/www/linuxfolk/sites/all/themes

I work at Drupar.com

shazi’s picture

your answer was right... and works now.. thanks...

Sonam Sodani’s picture

Thanks!! this worked for me.

onde_sou’s picture

I had the same problem and i solve easily with this command:
sudo chown www-data:www-data -R /var/www/drupal(or your drupal web root name)/sites

dehcar’s picture

You are right man you saved my life
but www-data:www.data didn't work for me
so i figured out from the error message that www-data is you server user or mybe you username
so for me on Fedora i tested on fedora 16/17/18/19

sudo chown apache:apache -R /var/www/drupal(or your drupal web root name)/sites

lprancourt’s picture

Lost many hours with this issue , and that was the solution. Thank you!

lidiya’s picture

i tried but it shows same warrning

mattrock1’s picture

Solved my problem. Big thanks!

lofra’s picture

Bigs thanks :-)

jorge_vicente’s picture

Thank you for the solution.

It's works!

Regards!

aaronsthomas74’s picture

I know its been a while since you posted this, but worked perfectly thank you for posting it.

rucbbq’s picture

Your method is pretty helpful! Thank you very much!

pratishjha’s picture

what should i do for the same issue in mac localhost

PretaJ’s picture

Only u solved my problem.

JerryVBarr’s picture

how can i move my sad quotes site in to drupal platform i,m also getting FTP connecting error in wordpress.

hi_ten_ja’s picture

sudo chown -R www:www /Library/WebServer/Documents/drupal_file/sites

sudo chown -R www:www /Library/WebServer/Documents/drupal_file/themes

as   www-data: illegal group name in MACOS

Bunda3D’s picture

how would I do this in Windows with SSH remote development? Can I go to my local files, start a git bash command line in the root folder of a site, and then what command? Because 

sudo chown apache:apache -R /var/www/

is not working. 

l.inux’s picture

The only correct solution is to setup an ftp server

sankhla.2’s picture

hello , i have same problem that 

i am cannot connect to FTP Server, check settings After trying to upload a Theme. It's give me error message 

  • Warning: Undefined property: Drupal\Core\FileTransfer\FTPExtension::$connection in Drupal\Core\FileTransfer\FTPExtension->connect() (line 16 of core/lib/Drupal/Core/FileTransfer/FTPExtension.php).
  • Failed to connect to the server. The server reports the following message:

    Cannot connect to FTP Server, check settings

 I am using xampp in mac os. Can someone help?