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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jome at emoj dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Dec 26 11:01:30 2024 UTC