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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.