如何通過PHP連接到ftps服務器?

[英]How do I connect to ftps server through php?


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

我想通過PHP連接到ftps服務器。我正在使用ftp_connect()

But I am getting this warning while connection:

但我在連接時收到此警告:

Warning: ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: No such host is known.

警告:ftp_connect()[function.ftp-connect]:php_network_getaddresses:getaddrinfo failed:沒有這樣的主機。

can any one help?

任何人都可以幫忙嗎?

2 个解决方案

#1


1  

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

PHP具有用於連接到“FTPS”服務器的內置功能,因為安全FTP通過SSL連接。查看ftp_ssl_connect的文檔。

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

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

Hope this helps!

希望這可以幫助!

#2


-1  

This means, it is not able to find the FTP server you are trying to connect. Either domain name doesn't exist or name resolution failed.

這意味着,它無法找到您嘗試連接的FTP服務器。域名不存在或名稱解析失敗。

I guess, you are trying to connect as,

我想,你正試圖連接,

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

For which you can use,

您可以使用,

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

Hope this helps.

希望這可以幫助。

If it does not work, Please check manual for ftp_connect again.

如果它不起作用,請再次檢查ftp_connect的手冊。

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

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


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/01/07/72f1fdde69a063e1151edee90c99c4b4.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com