I try to write a simple php webpage, which lets me reload apach2 config with a single click in the browser. I know, it's a security risk, but I still need it : )
I was able to do so, with a combination of sudo, and exec(), works fine. My only problem is, that when I write out the output of the command "/etc/init.d/apache2 reload", the only thing shows up is "Reloading webserver config: apache2", but the warning message (I put there some missig DocumentRoot dir for testing), won't show up.
It shows up using bash.
First I thought, I use the exec() command in a wrong way, but than I tried to put the output of the apache2 reload command to a file (in bash), and the warning message wasn't there too.
Actually one of the main purpose of the whole thing is to see if something missing after reload, so I need that Warning badly. Any idea, how can i catch that warning message? Or can I find it in some log file?
(I haven't tried it with error message, it might works with those, but I also need to get the warnings.)