RE: [PHP] run a command on a remote host

From: Date: Wed, 10 Dec 2003 18:31:36 +0000
Subject: RE: [PHP] run a command on a remote host
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-172373@lists.php.net to get a copy of this message
Thanks Vail and all! I use it: rsh -l user host command and and I can run it! Kisses! --- "Vail, Warren" <Warren.Vail@schwab.com> wrote: > Well, it is not possible directly, but you can try > some of the following; > > $cmd = "rsh -l user host command"; // remote shell > $cmd = "rpc -l user host command"; // remote > procedure call > $cmd = "rexec -l user host command"; // remote exec > $cmd = "ssh host command"; // secure shell > (recommended, but > not always available) > exec($cmd, $returnlines); // your php command for > one of the > above > foreach($returnlines as $line) echo $line."<br>"; > // output results > > I haven't checked the syntax of the various > commands, but I think this > answers your question about a few options that might > be available. rsh, > rexec, rpc and ssh are defined best in Unix > references, but many are also > available if your php server is windows based. > > good luck, > > Warren Vail > > > -----Original Message----- > From: Nathan Taylor [mailto:Lakario@msn.com] > Sent: Tuesday, December 09, 2003 3:48 PM > To: php-general@lists.php.net; Ivone Uribe > Subject: Re: [PHP] run a command on a remote host > > > When you say remote host do you mean the server > executing the script or the > person accessing it? > > If you mean the latter, it is not possible. > ----- Original Message ----- > From: Ivone Uribe > To: php-general@lists.php.net > Sent: Tuesday, December 09, 2003 5:44 PM > Subject: [PHP] run a command on a remote host > > > How can I run a command on a remote host wiht php? > > I'm trying this line but nothing happen. > passthru("rsh rubella > /export/dat0/users/augur-se/bin/.upnotify -s > 1045073262-82425_net2.nextelinternational.com -u > http://wap.peru.com -a -y D--- -i Location -n"); > > I try exec and system, too > > But if I run this from the command line of my > machine > the command run rightly. > > rsh rubella > /export/dat0/users/augur-se/bin/.upnotify > -s 1045073262-82425_net2.nextelinternational.com > -u > http://wap.peru.com -a -y D--- -i Location -n > > Thanks in advance, > Ivone > > > > __________________________________ > Do you Yahoo!? > Free Pop-Up Blocker - Get it now > http://companion.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: > http://www.php.net/unsub.php > __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/

« previous php.general (#172373) next »