php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69580 I need an FTP stream that doesn't use EPSV
Submitted: 2015-05-06 03:56 UTC Modified: 2015-05-06 20:32 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: a_different_name at hotmail dot com Assigned:
Status: Open Package: Streams related
PHP Version: 5.5.24 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: a_different_name at hotmail dot com
New email:
PHP Version: OS:

 

 [2015-05-06 03:56 UTC] a_different_name at hotmail dot com
Description:
------------
I'm trying to use streams to write a data file to an FTP server with a somewhat broken setup -- it understands `EPSV`, but is behind a NAT that doesn't.  So even though the `EPSV` succeeds, the data connection (and thus the `fopen`) fails because the router didn't set up a NAT entry for the data port.

This would not be a problem if i could tell PHP to skip `EPSV` and just use `PASV` instead (which works fine).  As it stands now, i instead have to either avoid streams, or write my own version of the FTP wrapper.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-06 04:18 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2015-05-06 04:18 UTC] requinix@php.net
Have you tried using the FTP functions? It looks like ftp_pasv() only attempts EPSV with an IPv6 connection.
 [2015-05-06 04:32 UTC] a_different_name at hotmail dot com
That's what i meant by "avoiding streams". I'm having to use the ftp_ functions instead.

The goal was to be able to hand the code a URL (which, ideally, could be any destination for which there's a stream wrapper registered), and have it put the file there. The need to avoid EPSV is getting in the way of that.
 [2015-05-06 20:32 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2020-04-08 13:29 UTC] mlechat at jolicode dot com
Just hit this one.

Would it be possible, either to

- try EPSV and switch to PSV on failure like cURL
- allow setting the mode as a context option
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 02 09:01:28 2024 UTC