Matt, Question: when you run it and it fails, are you running it with php from the command line under your own userid or are you running it under a web server by invoking the php file using a URL as userid (nobody)?
Warren Vail -----Original Message----- From: Matt Babineau [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 04, 2004 4:26 PM To: [EMAIL PROTECTED] Subject: [PHP] SCP a file from my server to another using PHP Hey All: Interesting problem that I haven't been able to solve using google. I want to move a file from my system using php, and I want to SCP it to another system. I setup the 2 keys and I can SCP files w/o using a password from the command line with no problem. When I take the same string that I jsut used to scp the file and run it using exec, system, passthru it doesn't work!! I'm baffled and was hoping someone had successfully done this before. Here is a chunk of code: $address = www.url.com; $value = "foldername"; if ($urlStatus == "Stopped") { $cmd = "scp /home/dev.site.com/mail_admin/commands/remove ".$gs['address'].":/home/www/$value/command"; echo " ".$cmd."<br>"; exec($cmd, $tmp, $rtmp); print_r($tmp); echo $rtmp; echo "<br><br>"; } TIA for anyone who has done this and knows the answer!!! -Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php