Jump to content

ftp_connect() error.


matthewlesh

Recommended Posts

Hello there,

 

i seem to be getting the following error in a php script i am writeing to check if an FTP server is up.

 

Warning: ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided

 

Can someone tell me what this means.. and what i should do about it?

Link to comment
https://forums.phpfreaks.com/topic/63857-ftp_connect-error/
Share on other sites

I'm not 100% sure, but I might have had this same error with fopen on external urls.

 

Try making a PHP page with:

 

<?php

echo phpinfo();

?>

 

And visiting it in a browser. Go to where it has SERVER_NAME and make sure that is right. If it is wrong, some functions give errors and it can't be a bitch to fix because it's the last thing you'd think to check.

 

If that isn't it, maybe post your code?

Link to comment
https://forums.phpfreaks.com/topic/63857-ftp_connect-error/#findComment-318266
Share on other sites

Well, That's a common error you get while using php with network.

Either the server is down or not properly configured.

If you are pointing it to a shared hosting account, well I doubt it would work.

If you are using a domain name to connect, try using the IP address.

Link to comment
https://forums.phpfreaks.com/topic/63857-ftp_connect-error/#findComment-318287
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.