How to connect to ftps server via php?

I want to connect to ftps server via php. I am using ftp_connect ()

But I get this warning when connecting:

Warning: ftp_connect () [Function.ftp connection]: php_network_getaddresses: getaddrinfo failed: this host is not known.

can anyone help?

+3
source share
2 answers

PHP has a built-in function for connecting to FTPS servers, since secure FTP is connected to an SSL connection. Check out the documentation for ftp_ssl_connect.

http://us.php.net/manual/en/function.ftp-ssl-connect.php

Hope this helps!

+1
source

, FTP-, . .

,

$server = 'ftpserver,port';
$connection = ftp_connect($server);

$server = 'ftpserver'; 
$port = 'port'; 
$connection  = ftp_connect($server,$port); 

, .

, ftp_connect.

http://php.net/manual/en/function.ftp-connect.php

-1

Source: https://habr.com/ru/post/1784016/


All Articles