When collecting FTP data, you need to use a PHP function ftp_connect. This function is to establish a new FTP connection. If it succeeds, it returns a connection identifier. If it fails, it returns FALSE.
ftp_connect() opens an FTP connection, parameters host is the server to connect to. The host should not end with a slash, and it does not need to start with ftp://. The optional parameter port is the port number of the FTP server to be connected. If it is not set or is 0, the default port 21 will be used to connect.
When I went to execute my program, I found the following error:
Copy the code The code is as follows:
PHP Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed:
I often found out later that it was a problem with IPtables, so I opened the default port of FTP and it can be used normally.
When encountering this kind of problem, you should first check the service of your own server, and the second is the firewall problem.
http://www.bkjia.com/PHPjc/764613.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764613.htmlTechArticleWhen collecting FTP data, you need to use a PHP function ftp_connect. This function is to create a new FTP Connection, returns a connection identifier if successful, returns FALSE if failed...