PHPverse 2025

Voting

: min(one, five)?
(Example: nine)

The Note You're Voting On

liubomyr dot pelo at gmail dot com
8 years ago
In case if you get:

Warning: ssh2_scp_recv(): Unable to receive remote file in /some-php-file.php on line 2

Use `stream_get_contents` function.

Example:
<?php
$stream
= @fopen("ssh2.sftp://$sftp$remoteFile", 'r');
if (!
$stream) {
throw new
\Exception("Could not open file: $remoteFile");
}

$contents = stream_get_contents($stream);
file_put_contents ($localFile, $contents);
@
fclose($stream);
?>

<< Back to user notes page

To Top