RE: [PHP] Solution to display the results of an exec/system + rsh command
| From: | Frédéric Martin | Date: | Fri, 19 Mar 2004 07:35:09 +0000 |
| Subject: | RE: [PHP] Solution to display the results of an exec/system + rsh command | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180941@lists.php.net to get a copy of this message | ||
Hi guys,
With the help of a guy, we found the solution. So for information, this is
what you have to do to succeed such kind of command.
You have to use the same username in your webserver as the name of the
account in the remote machine you're trying to access with rsh.
typically if you want to do this:
$res = exec("rsh x.x.x.x -l TOTO ping x.x.x.x");
echo "<pre> $res </pre>";
The webserver user should be TOTO (you can change it in your httpd.conf file
on Linux box)
hope it will help!
fred
-----Message d'origine-----
De : Chris W. Parker [mailto:cparker@swatgear.com]
Envoyé : jeudi, 18. mars 2004 17:59
À : frederic.martin@smart-telecom.ch; php-general@lists.php.net
Objet : RE: [PHP] Problem to display the results of an exec + rsh
command
Frédéric Martin <mailto:frederic.martin@smart-telecom.ch>
on Thursday, March 18, 2004 7:31 AM said:
> $res = exec("rsh x.x.x.x -l username ping x.x.x.x);
> echo "<pre> $res </pre>";
>
> I cannot display the result of the ping made in the remote host.
> any idea to fix that?
> thank you in advance for your tips ...
i don't have any idea why it's not working and i've never used exec(), but
maybe you'd have better luck with the back tick operator (at least i think
it's an operator)?
$res =
rsh x.x.x.x -l username ping x.x.x.x;
chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php