RE: [PHP] SCP a file from my server to another using PHP

From: Date: Wed, 05 May 2004 00:45:24 +0000
Subject: RE: [PHP] SCP a file from my server to another using PHP
Groups: php.general 
Request: Send a blank email to php-general+get-185383@lists.php.net to get a copy of this message
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:matt@crazyprotocol.com] Sent: Tuesday, May 04, 2004 4:26 PM To: php-general@lists.php.net 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 "&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 (#185383) next »