Ssh2 sftp使用PHP返回502坏网关
我正在尝试使用以下代码将图像上载到sftp服务器:Ssh2 sftp使用PHP返回502坏网关,php,apache,sftp,ssh2-sftp,Php,Apache,Sftp,Ssh2 Sftp,我正在尝试使用以下代码将图像上载到sftp服务器: //$this->sftp is a fully functioning ssh2_sftp variable $remotefile = "filename.jpg"; $url = "ssh2.sftp://". intval($this->sftp)."/".$remoteFile; 映像已上载,但服务器返回502 HTTP错误 我试过不用斜杠$url=“ssh2.
//$this->sftp is a fully functioning ssh2_sftp variable
$remotefile = "filename.jpg";
$url = "ssh2.sftp://". intval($this->sftp)."/".$remoteFile;
映像已上载,但服务器返回502 HTTP错误
我试过不用斜杠$url=“ssh2.sftp://”。intval($this->sftp)。“/”$remoteFile代码>但是我得到了以下错误
无法打开流:操作失败
我发现了这个问题,因为这个进程是异步的,所以我在进程完成之前关闭了sftp连接,触发了502错误。是什么导致了错误?我不认为您从SSH连接中得到HTTP错误。这就是问题所在。连接不是SSH而是SFTP,我真的不明白为什么添加反斜杠会使服务器返回502:C@AlexHowansky