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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Fri Dec 27 00:01:30 2024 UTC