I'm trying to run rate -c 192.168.122.0/24
command on my Centos computer and write down the output of that command to the text file using shell_exec('rate -c 192.168.122.0/24')
command; still no luck!!
If you don't need PHP, you can just run that in the shell :
rate -c 192.168.122.0/24 > file.txt
If you have to run it from PHP :
shell_exec('rate -c 192.168.122.0/24 > file.txt');
The ">" character redirect the output of the command to a file.