i have follwoing code
<?php
$handle = popen('rate -c 192.168.122.0/24 2>&1', 'r');
echo "$handle'; " . gettype($handle) . "\n";
$read = fread($handle, 2096);
echo $read;
pclose($handle);
?>
i want get the out put of this rate command to a text file its a third party tool to get the bandwith of the but when i run the code i got follwing error
‘Resource id #2’; resource sh: rate: command not found
but when i type rate command on my terminal i can see the out put
any ideas?
thank you all in advance
PHP can’t find the rate program. The PATH envorinment variable does not contain the folder where rate resides.
Set the PATH environment variable with putenv or give the full path in your call.