From: konix dot net at du dot t-com dot hr Operating system: Cent OS (Latest patch) PHP version: 5.2.8 PHP Bug Type: FTP related Bug description: Can not use ftp functions
Description: ------------ I'm trying to connect to FTP server from a script. Script is behind firewall. Only FTP port is allowed (application/script is to be used in PCIDSS enviroment). We tried same script on other servers and no problem accured at all. This could be a firewall / web application firewall (mod_security) issue but we're not sure. Reproduce code: --------------- $ftp_array = array( // Host, user, pass ); $port = 21; $network_timeout = 30; echo "Connecting...\n"; // Connect $ftp_connection = ftp_connect($ftp_array['host'], $port, network); if ($ftp_connection) { // Login if ($login = ftp_login($ftp_connection, $ftp_array['user'], $ftp_array['pass'])) { // Pasive mode ftp_pasv($ftp_connection, true); // Change dir ftp_chdir($ftp_connection, "in"); // Get dir listing $contents = ftp_nlist($ftp_connection, "."); // Echo list echo '<pre>'; print_r($contents); echo '</pre>'; } else { echo "Can't login to remote server."; } ftp_close($ftp_connection); } else { exit("Can't connect to remote server."); } Expected result: ---------------- Array ( [0] => . [1] => .. [2] => 11829_RATE_39.txt ) Actual result: -------------- Warning: ftp_nlist() [function.ftp-nlist]: php_connect_nonb() failed: Operation now in progress (115) in /var/www/html/public_html/ftp_test.php on line 30 -- Edit bug report at http://bugs.php.net/?id=47110&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47110&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47110&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47110&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47110&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47110&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47110&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47110&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47110&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47110&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47110&r=support Expected behavior: http://bugs.php.net/fix.php?id=47110&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47110&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47110&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47110&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47110&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47110&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47110&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47110&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47110&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47110&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47110&r=mysqlcfg