Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP
Hi Guys...
I want to connect remote server to ftp_put command. Different servers to correct example my remote server to incorrect. I get this error "Could not open data connection to port 10119". How to solve this problem ?
Thank you.
Posted 31-Dec-12 4:11am
Edited 31-Dec-12 4:13am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

FTP uses two sockets:
- One for the commands and responses. This one is opened by the client.
- One for the file transfer (data connection), this one is opened by the remote server in active mode, and this is the default.
In your case the server running your php script is the client and the other one is the remote server. Thus this later will try to open a connection back to your server. It is most likely, that there is a firewall in between, that is not aware of ftp. No problem, you have to set your ftp client to passive mode. Use the ftp_pasv[^] function to set the php ftp client to passive mode.
  Permalink  
v3
Comments
Espen Harlinn at 31-Dec-12 10:40am
   
Well answered :-D
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Very thank you I used
ftp_pasv($baglan, true);
this solved this problem
  Permalink  
Comments
ProgramFOX at 31-Dec-12 10:47am
   
If you've a comment to an answer, click on the "Have a Question or Comment?" button. Don't post a comment as an answer.
truvali89 at 31-Dec-12 13:07pm
   
I am sorry.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 725
1 OriginalGriff 385
2 CPallini 240
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,835
1 Sergey Alexandrovich Kryukov 5,198
2 CPallini 4,740
3 George Jonsson 3,167
4 Gihan Liyanage 2,470


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100