|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-13 18:09 UTC] pecl dot bugs at depoll dot de
[2007-09-06 15:35 UTC] maport1 at uky dot edu
[2007-09-09 11:40 UTC] spektom at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 02:00:01 2025 UTC |
Description: ------------ When executing an external program via the expect:// wrapper everything works as expected except for the "shutdown". The program becomes a zombie and stays in the processlist until Apache is restarted. This does NOT occur when executing the PHP script via command line. Same happens when executing screen or just something as simple as "echo", leaving the original shell, the program was executed in, as the zombie process. This might be an PHP or Apache bug but I don't think so, as the problem doesn't occur when using for instance popen(). ** PHP version: 5.0.5 './configure' \ '--prefix=/usr/local' \ '--with-apxs2=/usr/bin/apxs2' \ '--with-config-file-path=/etc' \ '--with-mysql=/usr' \ '--enable-mbstring' \ '--with-gd' \ '--with-zlib' \ '--with-mysqli' \ '--with-gettext' \ '--with-mcrypt' \ '--with-imap' \ '--with-openssl' \ '--with-kerberos' \ '--with-imap-ssl' \ '--enable-ftp' \ '--with-freetype' \ '--with-freetype-dir=/usr/include/freetype2' \ '--with-jpeg' \ '--enable-sockets' \ '--enable-memory-limit' \ '--enable-pcntl' \ '--enable-pty' \ '--enable-shmop' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--enable-sigchild' libexpect version: 5.43 Apache version: 2.0.54 Same happens when executing screen Reproduce code: --------------- <?php $shell = fopen('expect://bash', 'r+'); sleep(5); fwrite($shell, "exit\n"); sleep(5); fclose($shell); // following seems to close the shell (fclose() fails afterwards) but the shell becomes a zombie nevertheless $shell = fopen('expect://echo', 'r+'); sleep(5); fwrite($shell, "exit\n"); sleep(5); fclose($shell); ?> Expected result: ---------------- A bash process starts and just to get terminated again. Actual result: -------------- % ps aux | grep defunct www-data 21449 0.0 0.0 0 0 ? Zs 23:53 0:00 [bash] <defunct>