SCP a file from my server to another using PHP

From: Date: Tue, 04 May 2004 23:25:42 +0000
Subject: SCP a file from my server to another using PHP
Groups: php.general 
Request: Send a blank email to php-general+get-185380@lists.php.net to get a copy of this message
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 "&nbsp;&nbsp;".$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

« previous php.general (#185380) next »