我正在尝试使用以下方式连接到远程服务器:
$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()
它是空白的。
就我而言,这是因为我在主机名中添加了协议:
sftp://subdomain.domain.com
我改为:
subdomain.domain.com
它开始起作用了。