Here is the connection code itself.

<?php $host = "ftp://195.22.XXX.XXX"; $connect = ftp_connect($host); if(!$connect) { echo("Ошибка соединения"); exit; } else { echo("Соединение установлено"); } ?> 

And gives this error

 Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/u179140/landmarkstdru/educt/check_server.php on line 3 Ошибка соединения 

    1 answer 1

    The first argument to ftp_connect ($ host variable) must not contain the ftp: // prefix at the beginning.

    • Here I changed, now when I try to go on something stupidly endless download educt.landmarkstd.ru/check_server.php - Andrey
    • Do you have FTP running on port 21 and access from this machine is allowed (a firewall may not be configured and packets will be dropped)? - Firepro
    • The port range is from 1 to 50100, access to the database is only with accounting, the server is working, everything works through jav'y and filezilla. - Andrei
    • You do not have a connection to the FTP server from this host, so ftp_connect falls off at timeout - Firepro
    • sense? It’s great for me to connect via filezilla, through code in Java using the apach library, but with php there are troubles. - Andrey