|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-11 18:40 UTC] mario-dated-1110757160 dot 368950 at schmut dot com
[2005-02-13 00:25 UTC] pollita@php.net
[2006-05-15 14:28 UTC] mkoponick at redhawk dot info
[2007-12-14 13:16 UTC] christoph dot hintermueller at psi dot ch
[2010-02-26 22:45 UTC] info at busign dot nl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
Description: ------------ I notice after running some php scripts that connects, execute a few statements and then finish, that there are lingering proccesses on the remote host a linux box FC2, where a ps ax looks like 7102 ? S 0:00 sshd: watchdog [priv] 7104 ? S 0:00 sshd: watchdog@notty Upon closer inspection i find that this only happens when using libphp4 regardless of whether i dl load or preload using php.ini extension=ssh2. When running from the command line this does not happen at all. When using apache i have found no way around it. I've tried ssh2_exec($con, 'exit'), unset($con) and exit. There seems to be no hook for cleanup like there is when when the command line php proccess ends. And yes restarting apache frees the connections. Reproduce code: --------------- $con = ssh2_connect('hostname', 22); ssh2_auth_password($con, 'user', 'passwd'); ssh2_exec($con, 'uname'); exit; diff php.ini-dist php.ini 82c95 < precision = 12 --- > precision = 14 154c167 < allow_call_time_pass_reference = On --- > allow_call_time_pass_reference = Off 230c244 < max_execution_time = 30 --- > max_execution_time = 60 232c246,247 < memory_limit = 8M --- > memory_limit = 16M 287c302 < log_errors = Off --- > log_errors = On 382c397 < magic_quotes_gpc = On --- > magic_quotes_gpc = Off 428c443 < extension_dir = "./" --- > extension_dir = /usr/lib/php4 812,823c782 < ;session.save_path = /tmp --- > session.save_path = /var/lib/php/session 877c828 < session.bug_compat_42 = 1 --- > session.bug_compat_42 = 0 Expected result: ---------------- i expect php under apache to close ssh connection upon completion of the script, like cli php does.