|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-03-28 18:27 UTC] massimo at tuxel dot com
Using ssh through the various exec functions usually hangs
php execution. Very strange that:
exec('/usr/bin/scp foo@bar.com:/what/ever/file .')
works fine, while
exec('/usr/bin/ssh foo@bar.com /what/ever/execfile'),
where "execfile" is any executable file, makes the
execution of the php script hang.
Any help/reproduction/confirmation of this very
appreciated.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 18:00:01 2025 UTC |
I am experiencing this same issue on SuSE 9.1 with PHP 4.3.4 and OpenSSH 3.8. This is a more recent PHP than the one you offered up to solve the problem. I have narrowed it down to exec'ing ssh specifically. I am using passwordless public/private key authentication to a user account with very limited priveledges on the remote host. The ssh command to the remote host is actually executed, but PHP never comes back. The problem occurs using system(),shell_exec(), and popen(). I have reproduced this with a script as simple as: <?php system("ssh user@host mycommand_with_no_output"); ?> HTML GOES HERE The result is that PHP never comes back, and it does not error out either. Executing this via the command line works fine, executing it as a web-script hangs permanently.