I have simple php script that does a FTP between 2 servers.
<?php
$server = "ftp.server.com";
$ftp_user_name = "user123";
$ftp_user_pass = "pass123";
$connection = ftp_connect($server);
$login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);
if (!$connection || !$login) { die('Connection attempt failed!'); }
ftp_get($connection,"file1.txt","file1.txt",FTP_ASCII);
ftp_close($connection);
?>
When i run this script directly from the browser (http://www.mysite.com/script.php), the file tranfers without any problem. The file copies from server.com to mysite.com.
But when i try to run it from Cron, nothing happens. The file does not transfer and nor does it show any error. I have all other scripts running fine with cron. The cron command is :
/usr/local/bin/php /hsphere/local/home/user/mysite.com/script.php
Please help