php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64365 curl_setopt CURLOPT_FTPPORT doc is wrong
Submitted: 2013-03-06 02:43 UTC Modified: 2013-11-17 08:51 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sdfgsdf at thisisnotvalid dot com Assigned: krakjoe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
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: sdfgsdf at thisisnotvalid dot com
New email:
PHP Version: OS:

 

 [2013-03-06 02:43 UTC] sdfgsdf at thisisnotvalid dot com
Description:
------------
---
From manual page: http://www.php.net/function.curl-setopt#refsect1-function.curl-
setopt-parameters
---

CURLOPT_FTPPORT text is wrong, there is no such thing as FTP "POST".

Expected result:
----------------
The value which will be used to get the IP address to use for the FTP "PORT" 
instruction. The "PORT" instruction tells the remote server to connect to our 
specified IP address. The string may be a plain IP address, a hostname, a network 
interface name (under Unix), or just a plain '-' to use the systems default IP 
address.

Actual result:
--------------
The value which will be used to get the IP address to use for the FTP "POST" 
instruction. The "POST" instruction tells the remote server to connect to our 
specified IP address. The string may be a plain IP address, a hostname, a network 
interface name (under Unix), or just a plain '-' to use the systems default IP 
address.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-20 19:43 UTC] sdfasdf at thisisnotvalid dot com
Additionally, the explanation of what the options actually *do* needs work.  Options are listed as if they were all equally typical / normal / necessary, when in fact some of them are quite esoteric, rarely if ever necessary.  

Just looking at the name of CURLOPT_FTPPORT, one might expect that it was an alternative way to specify the FTP port.  In the modern-since-1998 EPSV mode, there is only one FTP port that is explicitly given a number, so by that standard there is only one FTP port.  

Unfortunately, as an old and hoary protocol, there is technically no such thing as 'the' FTP port, because FTP supports all sorts of oddball modes.  In old-school PASV mode, and especially in old-bordering-on-ancient-school active mode where PORT is used, that modern assumption is no longer the case.  The PHP helpdocs ought to reflect that, in general, unless you are doing something weird, FTPPORT is not gonna be useful.  (Right now they are just a cut-n-paste of the cURL helpdocs... but with brain-o mistakes like POST-vs-PORT added in!  Better to document the common options in an easy-to-understand way, and refer to the official helpdocs on the official webpage ... or else, make sure the php helpdocs are an improvement rather than a detriment.)  

Here is an example where FTPPORT was required:  

  http://stackoverflow.com/questions/13914262/ftp-fails-to-transmit-data-in-passive-mode-libcurl

Here is a case where EPSV and PASV and a misconfigured FTP server demand some of the esoteric options be put into realworld use:  

  http://www.unixlore.net/articles/using-curl-for-ftp-over-ssl-file.html
 [2013-11-17 08:50 UTC] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&revision=332147
Log: fix #64365
 [2013-11-17 08:51 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2013-11-17 08:51 UTC] krakjoe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=0879aae57587a3ac530e952d06f624fe88af3f67
Log: fix #64365
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 09:00:02 2026 UTC