Hi Guys,
We are testing our site in Amazon AWS and site is built in PHP uses Apache and Mysql.
My problem is i have 2 instances(say source and destination). I want to move file from source instance to destination instance(or say create a file on dest instance from the script running in source instance), for this i am using PHP ftp_put() but i am getting Warning: ftp_put(): Security: Bad IP connecting. in /opt/lampp/htdocs/test.php.
Also i am able to upload files to instance using WinSCP/FileZilla!!!!
Kindly help me to resolve this issue.....
Below is my code
$file = 'source.txt';
$remote_file = '/var/www/readme.txt';
// set up basic connection
$conn_id = ftp_connect('XX.XX.XXX.XX');
// login with username and password
echo $login_result = ftp_login($conn_id, 'XXXXX', 'YYYYYYYY');
// turn passive mode on
ftp_pasv($conn_id, true);
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
echo "successfully uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection
ftp_close($conn_id);
Thx in adv :)