I'm making a really simple virtual host administrator in my office intranet (on a windows pc) and I'm trying to restart the apache service from php when a new virtual host is created.
But I can't manage to do it, I tried with apache -k restart, httpd -k restart with the system, shell_exec, exec passthru; I also tried using a batch file and executing it from php commands but no avail. There are no errors, the command just doesn't get executed
The only way I managed to stop (but not to restart) the service was by making NET STOP Apache2.2, and making a batch file with:
@echo off NET STOP Apache2.2 NET START Apache2.2
didn't work either.
Any idea why? I'm clueless here. Other commands get executed just fine, but for some reason php doesn't want to restart the apache service.
Thanks!