|
Posted by John on 07/17/07 15:22
"C." <colin.mckinnon@gmail.com> wrote in message
news:1184593707.079630.37340@n2g2000hse.googlegroups.com...
> On 16 Jul, 11:52, "John" <john1...@yahoo.com> wrote:
>> Hi
>>
>> There is an odd problem.
>> The following works fine on one web server, but the same code hangs on a
>> different server.
>> I can login but the problem is at the following line.
>>
>> $down=ftp_fget($connect,$handle,$remotefile,FTP_BINARY);
>>
>> Any ideas why this is happening?
>
> FTP uses a second connection for data (first connection used for
> control) which can cause problems with firewalls. Try using passive
> mode (ftp_pasv())
>
> HTH
>
> C.
>
You're right. I added the ftp_pasv and we're working again.
$login=ftp_login($connect,$user,$pass);
if (!$login) die ("Unable to login." . $lf . $dot);
ftp_pasv($connect,true);
$down=ftp_fget($connect,$handle,$remotefile,FTP_BINARY);
But where has this firewall appeared from? The program was working OK on
both servers.
And I haven't touched anything!
Regards
John
Navigation:
[Reply to this message]
|