Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

ftp_get() stopped working. Can't work out why

$
0
0

Hi guys

 

I'm not sure this is a PHP coding problem but it may be so I'm posting here anyway. I've got a script that runs as a cron job every few minutes that uses ftp_get() to pull a file from another server. I set this up in 2011 and it's been working flawlessly until a few days ago. I've just TeamViewered in to the remote computer where the files are being pulled from and had a look at the Filezilla FTP log. It's showing the successful FTP connection with the script but is then throwing a "425, Can't Open Data Connection" error.

 

I've just opened Dreamweaver and used exactly the same settings (remote address, user name, password etc.) and I was able to successful select and pull the file down via FTP. I checked the Filezilla log and transfer was successful with no 425 errors.

 

Here's the code in my script. It's very simple:

 
 
$c = ftp_connect('www.remotesite.com')     or die("Can't connect");
 
ftp_login($c,'username','password')     or die("Can't login");
 
ftp_get($c, $local_filelocation,$remote_filelocation, FTP_ASCII);
 
 

Viewing all articles
Browse latest Browse all 13200

Trending Articles