通过使用followign代码,如果我回显$stream,我会得到结果“Resource id #5”
我在 apache (linux) phpinfo 上使用 PHP 7.0:
- SSH2
- 扩展版本 0.12+dev
- libssh2 版本 1.5.0
横幅 SSH-2.0-libssh2_1.5.0*
<?php // $server = ... etc. $connection = ssh2_connect($server, $port); ssh2_auth_password($connection, $username, $password); $sftp = ssh2_sftp($connection); $filename = 'test.csv'; $stream = fopen("ssh2.sftp://" . intval($sftp) . "/dir/$filename", 'r'); echo $stream; // Result: "Resource id #5" ?>
结果是“Resource id #5”,我不知道我做错了什么