How to list files of a directory in an other server using ssh2

后端 未结 4 1367
北海茫月
北海茫月 2020-12-16 13:49

I would like to list the files of a directory in an other server

I am connected to an other server using ssh2_connect function the connection is going well and I am

4条回答
  •  北海茫月
    2020-12-16 14:42

    In case anybody is struggling to get this to work, and you are running PHP 5.6.28 there was a recent update that either created a requirement or introduced a bug where intval() must be used on each SFTP folder/file access function:

    $handle = opendir("ssh2.sftp://".intval($sftp)."/path/to/directory");
    

提交回复
热议问题