The code works just fine if I use it within the same domain. (i.e. I execute the script on my mediatemple server, and define the FTP info as an FTP account within the same domain).
However, when I run the script on my mediatemple account, and define the FTP info on a different domain (a different mediatemple-hosted FTP site, different domain), it does nothing, then times out after 90 seconds.
Can anybody tell me what I'm doing wrong?
Code: Select all
<?php
$ftp_server=<IP address>;
$ftp_user_name =<username>;
$ftp_user_pass =<password>;
// set up basic connection
$conn = ftp_connect($ftp_server) or die("Could not connect");
if(ftp_login($conn,$ftp_user_name,$ftp_user_pass)){
echo("connected<br>"); //this works no matter what
echo ftp_systype($conn); //this also works
print_r(ftp_nlist($conn,"images")); //this makes it hang and timeout after 90 secs
};
ftp_close($conn);
?>