#44360 [NEW]: Each new instance of ftp_connect breaks other connections in other scripts

From: Date: Fri, 07 Mar 2008 09:13:51 +0000
Subject: #44360 [NEW]: Each new instance of ftp_connect breaks other connections in other scripts
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123015@lists.php.net to get a copy of this message
From: upandhigh at gmail dot com Operating system: Fedora Core 6/8 PHP version: 5.2.5 PHP Bug Type: FTP related Bug description: Each new instance of ftp_connect breaks other connections in other scripts Description: ------------ When you trying to use FTP connections from different PHP scripts, the new created connection from one THREAD or FILE running - breaks another connection what was made from other THREAD or FILE. Reproduce code: --------------- if ($pid = pcntl_fork()) { $my_pid = getmypid(); print $pid." - ".$my_pid."\n"; $a = ftp_connect("ftp.debian.com", 21, 5); echo $a; sleep(10); } else { $my_pid = getmypid(); $b = ftp_connect("ftp.kernel.org", 21, 5); echo $b; sleep(10); } Expected result: ---------------- This code will return Resource Id#4 for all threads. So if we will download or upload files with $b - connection ID it will be stopped when another thread will be started, with $a - connection ID. It happens when code started from different CLI FILES, or from FORKED processes of one source file. Actual result: -------------- Well I just wanted to have several FTP connections from one server - but seems it's impossible, because each new connection - breaks previous one what was made from other script. -- Edit bug report at http://bugs.php.net/?id=44360&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44360&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44360&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44360&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44360&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44360&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44360&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44360&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44360&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44360&r=support Expected behavior: http://bugs.php.net/fix.php?id=44360&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44360&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44360&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44360&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44360&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44360&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44360&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44360&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44360&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44360&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44360&r=mysqlcfg

« previous php.bugs (#123015) next »