Click here to Skip to main content
12,763,360 members (29,360 online)
Rate this:
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 5:11am
Updated 31-Dec-12 5:13am
Rate this: bad
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.
Espen Harlinn 31-Dec-12 10:40am
Well answered :-D
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Very thank you I used
ftp_pasv($baglan, true);

this solved this problem
ProgramFOX 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2017
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