ebess's avatar

FTP on Homestead

Hey guys,

im trying to use FTP von my homestead environment, but I get an error while trying to upload a file:

[ErrorException]
  ftp_fput(): I won't open a connection to 10.0.2.15 (only to <my-ip>)

Do i need to forward some ports or something? Hope you can help me!

Cheers

0 likes
6 replies
christopher's avatar

Does not know if pureftp or something like that is installed on homestead. Maybe try it with SFTP.

ebess's avatar

Well, FTP is installed in PHP. But it will not let the request to the destination server or something like that. Maybe homestead sends some private IP, so the request is rejected by the remote server. Don't really know.

ian_h's avatar
ian_h
Best Answer
Level 20

@ebess have you tried calling ftp_pasv()?:

$conn = ftp_connect($serverConnDetails);
$loginResult = ftp_login($conn, $username, $passwd);
ftp_pasv($conn, true);

[ ... ]

Looks like it might be a passive vs active issue.

Cheers..

Ian

2 likes
osc2nuke's avatar

I was already $vagrant SSH, then i thought, why not give it a shot. ( PHP Manual only use that for ftp_put(...), so i made assumption not for ftp_get(...) ). Thnx!!

Please or to participate in this conversation.