ID: 45425 Comment by: aaron at stormsemi dot com Reported By: aaron at stormsemi dot com Status: Feedback Bug Type: Program Execution Operating System: Linux-2.6.15 PHP Version: 5.2.1 New Comment:
I tried php5.2-200807040030 and got the same result, the problem seems caused by popen(), when a parent process that bind to a specific port and spawn a child process then the child process inheres the existent socket opened by parent process. Previous Comments: ------------------------------------------------------------------------ [2008-07-03 11:50:06] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi ------------------------------------------------------------------------ [2008-07-03 06:20:54] aaron at stormsemi dot com Description: ------------ localhost> /mnt/data/public/lsof -i :80 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME httpd 1219 root 5u IPv4 2941 TCP *:http (LISTEN) httpd 1220 www_user 5u IPv4 2941 TCP *:http (LISTEN) httpd 1221 www_user 5u IPv4 2941 TCP *:http (LISTEN) httpd 1222 www_user 5u IPv4 2941 TCP *:http (LISTEN) httpd 1223 www_user 5u IPv4 2941 TCP *:http (LISTEN) httpd 1224 www_user 5u IPv4 2941 TCP *:http (LISTEN) httpd 1225 www_user 5u IPv4 2941 TCP *:http (LISTEN) httpd 1226 www_user 5u IPv4 2941 TCP *:http (LISTEN) socktest 1235 www_user 5u IPv4 2941 TCP *:http (LISTEN) socktest 1235 www_user 10u IPv4 2956 TCP stornas.com.tw:http->192.168.2.36:2217 (FIN_WAIT2) socktest listen to port 80 Reproduce code: --------------- The environment is as below: CPU: ARM 920 OS: Linux2.6.15 or Linux 2.6.25 Apache2: 2.2.3 PHP: 4.3.8 (libphp4.so) or 5.2.1 (libphp5.so) compiler: gcc 3.4.4 for ARM test.php <?php $output=array(); $return_var=0; exec("/mnt/data/public/socktest > /dev/null &", $output, $return_var); ?> If change to Apache/1.3.33 (Unix) PHP/4.3.8 configured PHP is statically linked with apache, and execute the same test.php socktest does not catch port 80. socktest is a small program which listen to port 1212 and daemonize itself. PC side using IE http://192.168.2.137/test.php Expected result: ---------------- socktest should not listen to port 80, because it only listen to port 1212 Actual result: -------------- socktest listen to port 80 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45425&edit=1
