无法使用 Net_SFTP 连接到远程 SFTP 服务器

问题描述 投票:0回答:1

我正在尝试使用以下方式连接到远程服务器:

$sftp = new Net_SFTP($sftp_server,$port_no);  

$port_no
$sftp_server
是正确的。我可以使用相同的方法通过 FileZilla 通过 SFTP 连接到服务器。

但是,当使用 Net_SFTP 时,

$sftp->login
失败。
我收到错误:

Cannot connect to $sftp_server:$port_no. Error -446736096. Unable to find the socket transport "https" - did you forget to enable it when you configured PHP?

当我这样做时

$sftp->getLog()
它是空白的。

php sftp
1个回答
0
投票

就我而言,这是因为我在主机名中添加了协议:

sftp://subdomain.domain.com

我改为:

subdomain.domain.com

它开始起作用了。

© www.soinside.com 2019 - 2024. All rights reserved.