PHP_NETWORK_GETADDRESSES: GETADDRINFOFAILED solution _ PHP Tutorial

Source: Internet
Author: User
Tags default ftp port ftp connection
PHP_NETWORK_GETADDRESSES: GETADDRINFOFAILED solution. 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, if it fails, FALSE is returned. a PHP function ftp_connect is required for FTP data collection. this function creates a new FTP connection. if it succeeds, a connection id is returned, otherwise, FALSE is returned.
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:

The 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.

FTP connection. if the connection is successful, a connection identifier is returned. if the connection fails, FALSE is returned...

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.