I have TeamSpeak3 installed don my server and I want to make a small script that shows if TS3 is up or down
Configuration :
CentOS 7 Php 5.6.24
I tried this script but didn't work for me :
exec("pgrep ts3server", $pids);
if(empty($pids)) {
echo "ts3server is not running!";
}
when I echo the $pids I get nothing it's empty, and when I run the command "pgrep ts3server" I get this result : 11149.
Added Info:
Yes I have root access, and I think that exec isn't installed because I don't get any results from this :
<?php
if(function_exists('exec')) {
echo "exec is enabled";
}
echo exec('whoami');
?>
I tried to enable but can't find nothing about in php.ini!