php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16348 (PHP4.2.0RC1) ftp_connect() argument problem
Submitted: 2002-03-29 12:07 UTC Modified: 2002-03-29 20:59 UTC
From: jome at emoj dot net Assigned:
Status: Closed Package: FTP related
PHP Version: 4.1.2 OS: Linux
Private report: No CVE-ID: None
 [2002-03-29 12:07 UTC] jome at emoj dot net
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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-29 20:59 UTC] mfischer@php.net
Fixed in CVS and 4_2_0, thx.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 18:01:30 2024 UTC