|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-15 12:43 UTC] langemeijer@php.net
-Status: Open
+Status: Duplicate
[2012-06-15 12:43 UTC] langemeijer@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 19:00:01 2025 UTC |
Description: ------------ When an SSH2 Session (ssh2_connect result) is used with ssh2_shell, it cannot be used with ssh2_exec or any scp file transfert. Why ? Reproduce code: --------------- <?php $ssh = ssh2_connect('localhost', 22); $co = ssh2_auth_password($ssh, 'root', 'UXrFzhCyZkt7999dX3mHB2'); var_dump($co); $shell = ssh2_shell($ssh, 'vanilla', null, 90, 50, SSH2_TERM_UNIT_CHARS); var_dump(fgets($shell, 1024)); var_dump(fgets($shell, 1024)); $exec = ssh2_exec($ssh, 'pwd'); var_dump($exec); ?> Expected result: ---------------- bool(true) string(X) "[...]" string(X) "[...]" resource(X) of type (stream) Actual result: -------------- bool(true) string(X) "[...]" string(X) "[...]" Warning: ssh2_exec(): Unable to request a channel from remote host in /home/d-sites/myonlinessh/tests/ssh-rps-reuse.php bool(false)