【发布时间】:2019-04-03 14:18:58
【问题描述】:
通过使用后续代码,如果我回显 $stream,我会得到结果“资源 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”,我不知道我做错了什么
【问题讨论】:
-
不确定您认为哪一部分有问题?在我看来是预期的。
-
我想获取 CSV 文件的内容,但我在浏览器“Ressource id #5”中得到结果,但我不知道为什么