Here is the code that I'm using. Note that there is a space between the shell_exec and the brackets (). Thats because phpfreaks.com tells me '403 forrbidden You don't have permission to access /forums/index.php on this server.' if I don't have that space there.
// This is the code $cmdline = $server_exe.' -k stop'; $rslt = shell_exec ($cmdline); print_r($GLOBALS); echo '<HR>Result<HR>'.$rslt;
This is the result that I get from print_r($_GLOBALS);
[include_file] => C:\FTB\dptr1988.mooo.com\htdocs\local\sample.conf [apache_dir] => C:/Program Files/Apache Group/Apache2/conf/ [current_file] => C:/Program Files/Apache Group/Apache2/conf/dptr1988.mooo.com.conf [server_exe] => "C:/Program Files/Apache Group/Apache2/bin/apache.exe" [cmdline] => "C:/Program Files/Apache Group/Apache2/bin/apache.exe" -k restart [rslt] =>
The command line works when I enter it in the command prompt, so it's a good command line.
Is there a better way to run programs instead of using shell_exec()?