passthru()/exec()/system() Errors
| From: | Robert Hinojosa | Date: | Wed, 30 Apr 2003 06:42:21 +0000 |
| Subject: | passthru()/exec()/system() Errors | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-145733@lists.php.net to get a copy of this message | ||
I can do passthru("ls -la"), etc. just fine. but I am unable to do a
passthru("fping .")
Fping is a very useful utility, and I'd very much like to use it in my PHP
scripts but am currently unable to. Via command line, it works perfectly.
But through Apache, I get no output.
<?php
passthru("fping -sdC 1 localhost");
?>
# php test2.php
localhost : 0.37
1 targets
1 alive
0 unreachable
0 unknown addresses
0 timeouts (waiting for response)
1 ICMP Echos sent
1 ICMP Echo Replies received
0 other ICMP received
0.37 ms (min round trip time)
0.37 ms (avg round trip time)
0.37 ms (max round trip time)
0.503 sec (elapsed real time)
localhost : [0], 84 bytes, 0.37 ms (0.37 avg, 0% loss)
Browser:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=iso-8859-1"></HEAD>
<BODY></BODY></HTML>
(Nothing)
Fping is in /usr/sbin, but I've also tried moving it to /sbin, /bin, the
same dir as the PHP script, chown'ing to nobody, etc.
Any suggestions? I've had many problems with permissions in my command
executions, but never this much.
- Robert