question about using shell_exec

ml4088

Mike
I can run the ssh command and get my results and I can run php -f ntp-status.php and get my results but when I access this on the same box via a web interface I dont get any results

[
<?php
$output0 = shell_exec("ssh pi@192.168.20.99 ntpq -p ");
echo "<pre>";
echo "$output0</pre><br>";
?>
]

pi@mrtg:/var/www/mrtg $ php -f ntp-status.php
<pre>
remote refid st t when poll reach delay offset jitter
===============================================================================
SHM(2) .PPS. 0 l - 16 0 0.0000 0.0000 0.0005
SHM(0) .GPS. 0 l - 16 0 0.0000 0.0000 0.0005
0.debian.pool.n .POOL. 16 p - 256 0 0.0000 0.0000 0.0005
1.debian.pool.n .POOL. 16 p - 256 0 0.0000 0.0000 0.0005
2.debian.pool.n .POOL. 16 p - 256 0 0.0000 0.0000 0.0005
3.debian.pool.n .POOL. 16 p - 256 0 0.0000 0.0000 0.0005
*b1-66er.matrix. 129.6.15.30 2 u 27 128 377 36.4493 -2.3904 11.3066
+ip229.ip-51-81- 192.168.10.254 2 u 357 128 144 99.8035 -1.3989 7.4274
-ovh.saclay.org 84.102.220.168 2 u 8 128 377 124.9910 3.3804 3.3205
+jane.qotw.net 42.20.202.230 2 u 232 128 232 62.4263 1.1343 8.5864
-y.ns.gin.ntt.ne 129.250.35.222 2 u 20 128 337 35.9823 7.3147 6.2826
-ntp3.radio-suns 254.48.138.1 2 u 29 128 377 120.0298 4.5362 7.4855
+blotch.image1te 129.6.15.29 2 u 19 128 377 60.8887 -1.8651 8.9705
</pre>
 
Back
Top