PHP 8.4.24 Released!

Voting

: nine minus five?
(Example: nine)

The Note You're Voting On

guilhem at no dot spam dot answeb dot net
8 years ago
Please beware of a PHP bug, noted by thomas at gielfeldt dot dk, that you must intval() the connection variable before putting it in the connection string :

<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
// See: https://bugs.php.net/bug.php?id=73597
$stream = fopen("ssh2.sftp://" . intval($sftp) . "/path/to/file", 'r');
?>

<< Back to user notes page

To Top