|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-07 13:40 UTC] upandhigh at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
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.