Ftp_connect(): php_network_getaddresses: getaddrinfo failed: name or service not known
I was trying to connect with ftp server using ftp_connect() function of PHP as shown below: Show
But it returns this error:
Although this is a very common type of error, I still cannot find any solution. Can anyone provide some possible solutions? Thank you for your time. asked Jun 30, 2011 at 14:34
Quazi FarhanQuazi Farhan 1,3857 gold badges16 silver badges29 bronze badges You must supply only the ftp server hostname, rather than the hostname and directory path, and the irrelevant
See the full documentation of PHP's FTP functions. answered Jun 30, 2011 at 14:37
Michael BerkowskiMichael Berkowski 263k45 gold badges434 silver badges380 bronze badges 1 Get rid of the answered Jun 30, 2011 at 14:35
Not the answer you're looking for? Browse other questions tagged php ftp or ask your own question.I try to use the php ftp_connect fucntion on my dedicated server and I'm unable to establish a connection:
I'm sure the function is available as I test with :
and it returns true When I ftp the server through the shell I can reach it so I guess it's not a firewall issue. Am I missing something else ? Thanks for your precious advices asked Sep 5, 2012 at 8:39
2 PHP will log a warning if To diagnose this problem without access to logs, try running PHP from the command line. For instance:
Ctrl+D
answered Sep 5, 2012 at 22:27
Michael HamptonMichael Hampton 237k42 gold badges476 silver badges938 bronze badges Not the answer you're looking for? Browse other questions tagged php ftp or ask your own question.
11 Years Ago Hi I am trying to connect my server through PHP script as below. But i am unable to reach my server and getting error. If i connect my server through ftp software with FTPES protocol my server is getting connect I am getting an Error as "Warning: ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp\htdocs\uploadftp.php on line 13
Recommended Answers
Jump to Post
Jump to Post All 5 Replies
sDJh 39 Posting Whiz in Training I advice you to have a deep look into your code or in the internet. This problem could be caused by anything. You could have a typing error, or try to connect to a computer without ftp-server, or your extension doesn't work or your firewall, router... What about connecting to that computer via a ftp-client?
11 Years Ago
Hi i have explained the thing in the above post itself. If i connect my server through ftp software with FTPES protocol my server is getting connect
sDJh 39 Posting Whiz in Training Hi rpv_sen, I'm sorry to say, but in my point of view, you haven't. Not getting access to a FTP-server does not necessary be a fault of PHP. For some good advice, we actually need more details. As I said before, this problem can be caused by almost anything thinkable. Greetings
Nahiyan 7 Junior Poster in Training 11 Years AgoWe need more information to solve this issue.
11 Years Ago hi Thanks for your reply, I am able to connect my FTP through file-zilla, that to i have specify the protocol as below ftpes://domainname.com we don't have any firewall system. Reply to this topic Be a part of the DaniWeb community We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge. |