Bug #16348: (PHP4.2.0RC1) ftp_connect() argument problem
| From: | jome at emoj dot net | Date: | Fri, 29 Mar 2002 17:07:09 +0000 |
| Subject: | Bug #16348: (PHP4.2.0RC1) ftp_connect() argument problem | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-3616@lists.php.net to get a copy of this message | ||
From: jome@emoj.net
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