1

if i try the following command:

$_content = file_get_contents("ssh2.sftp://".intval($sftp)."/Lorem-62398848890105_20190117-101229.txt");

it works and i get the correct content. But whenever I want to have all the files of the remote folder, the directory can not be opened.

I tried scandir or opendir. Both of these raises this message:

Warning: scandir(): Unable to open ssh2.sftp://12/ on remote host

What im doing wrong? Some tips would really help me.

Regards

Context: I use PHP 7.0.32 and ssh2.so is fully installed


UPDATE: I got it. I think it is due to a wrong attitude of the provider. How it works:

$handle = opendir("ssh2.sftp://".intval($sftp).ssh2_sftp_realpath($sftp,".").'./');

The function ssh2_sftp_realpath + './' do the trick.

mainline
  • 41
  • 6

0 Answers0