Click here to Skip to main content
14,696,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Updated 31-Dec-12 5:13am

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
Very thank you I used
ftp_pasv($baglan, true);

this solved this problem
Thomas Daniels 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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900