I want to connect to a remote server whose ip adress is xx.xxx.xxx.xx to later write on a file on it. Here my php code:
<?php
$remote_file = 'test_remote.txt';
$file = 'test.txt';
$conn_id = ftp_connect('xx.xxx.xxx.xx') or die("Could not connect")
$login_result = ftp_login($conn_id, 'name', 'passwd');
if (ftp_fput($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "ok";
} else {
echo "failed";
}
ftp_close($conn_id);
?>
I get the error "Could not connect"....
If I do
ssh name@xx.xxx.xxx.xx and entered the password it works fine. What is the problem?
Thanks