connecting to an ftp host from php script?

BMW

New member
i have an ftp site that i can ftp to from the command line in windows. however when i tried to ftp from a php program i'm not able to connect to host. what could be the problem? i'm suspecting it could be the vista firewall "protecting" this but i ok'ed it from the command line already. what can i do?

// FTP access parameters
$host = 'abcdefg.com';
$usr = 'username';
$pwd = 'passwordhere';

print "now doing ftp\n";
// file to move:
$local_file = "123.txt";
$ftp_path = './';

// connect to FTP server (port 21)
$conn_id = ftp_connect($host) or die ("Cannot connect to host");
--- the program dies here -------
I verified that it is the windows firewall (if i turn off the firewall it works). I added php.exe and the program.php to the exception list, but when i ran "php program.php" with firewall on, it's still not connecting
 
Back
Top