This article describes how to solve the PHP_NETWORK_GETADDRESSES: GETADDRINFOFAILED problem. For more information, see
This article describes how to solve the PHP_NETWORK_GETADDRESSES: getaddrinfo failed problem. For more information, see
When collecting FTP data, you need to use a PHP function ftp_connect to establish 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:
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.