From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.1.2 PHP Bug Type: FTP related Bug description: (PHP4.2.0RC1) ftp_connect() argument problem
This has been discussed on the php-qa-list and it looks like you have to use ftp_connect("localhost",0,21); instead of ftp_connect("localhost",21); I've not understood what the 0 in the above example represents. While excluding the port argument (and the zero) no problem occurs. <whatLizsaid> OK, Opens a FTP stream */ PHP_FUNCTION(ftp_connect) { ftpbuf_t *ftp; char *host; int host_len, port = 0; long timeout_sec = FTP_DEFAULT_TIMEOUT; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILUR E) { return; } If you do ftp_connect("localhost",0,21); it connects, I don't know what host_len is, but you need to specify it before port.. Bug? </whatLizsaid> -- Edit bug report at http://bugs.php.net/?id=16348&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16348&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16348&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16348&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16348&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16348&r=support Expected behavior: http://bugs.php.net/fix.php?id=16348&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16348&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16348&r=submittedtwice