Hi,
It seems that you want to use "exec()" as an application launcher. Sorry, but that's not how it works.
All PHP functions able to run an executable file:
- exec()
- passthru()
- shell_exec()
- system()
do not have this executable in a window as would be done with Windows and double-click.
You MUST use the implementing return parameters and test their content.
Example:
$command = 'start /b /wait httpd.exe -v | find "built"';
$output = exec($command, $result);
if(strpos($output, "32-bit" ) !== false)
$Apache = "32 bit version";
elseif(strpos($output, "64-bit" ) !== false)
$Apache = "64 bit version";
or
$command = 'start /b /wait httpd.exe -t -D DUMP_VHOSTS';
ob_start();
passthru($command);
$output = ob_get_contents();
ob_end_clean();
if(!empty($output)) {
... Processing command output
}
And if I put a link to the OFFICIAL documentation of the exec() function, it is for you to read it. This, a priori, you did not do, or you would understand why you want to do WILL NOT WORK.
And by the way this forum is not a PHP coder assistance site.
Edited 2 time(s). Last edit at 04/10/2015 04:05PM by Otomatic.