PHP_NETWORK_GETADDRESSES: getaddrinfo failed solution

Source: Internet
Author: User
Tags default ftp port ftp connection

When collecting FTP data, you need to use a PHP function ftp_connect, which establishes a new FTP connection. If a connection ID is returned successfully, FALSE is returned if the connection fails.
Ftp_connect () opens an FTP connection. The host parameter is the server to be connected. The host must not end with a slash, nor must it start with ftp. The optional parameter port is the port number of the FTP server to be connected. If it is not set or 0, the default port 21 is used for connection.
When I run my program, the following error is reported:
Copy codeThe Code is as follows: PHP Warning: ftp_connect (): php_network_getaddresses: getaddrinfo failed:
I often find that the problem is IPtables, so I opened the default FTP port, so it can be used normally.
In this case, you must first check the services on your server, and then the firewall.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.