I'm trying to make a simple control panel for my webserver running nginx with php-fpm.
I've managed to catch result of
service php5-fpm restart and
service nginx reload, but the output from
nginx -t apparently doesn't work the same way?
I've tried with
$out = shell_exec('nginx -t');, like I use for the other 2 examples above. But when I run the script, it just prints out the result and the variable
$out is null.
I've also tried with both
shell() using the output argument and
popen() combined with
fread(), but that's the same outcome.
What I want to achieve is updating a field in my mysql database with the result of
Is there anyway to do this?