In doing FTP data collection, you need to use a PHP function Ftp_connect, this function is to establish a new FTP connection, if the successful return of a connection identity, failure returns FALSE.
Ftp_connect () opens an FTP connection with the parameter host as the server to which you want to connect. The host should not end with a slash, and the front does not need to start with a ftp://. Optional parameter port is the port number of the FTP to which you want to connect, if it is not set or 0, the default port 21来 connection is used.
When I went to execute my program, I found the following error:
Copy Code code as follows:
PHP warning:ftp_connect (): Php_network_getaddresses:getaddrinfo failed:
Often found after the problem is iptables, so I opened the FTP default port, so it can be used normally.
Encounter this kind of problem to check the service of own server first, second is firewall problem.