PHP exec in background does nothing on Windows 10
Posted: 03. November 2019 19:51
Hello there,
I am really happy with XAMPP, only I just am not able to run any php exec command in the background or at all. So I tried:
- starting XAMPP as admin
- Install services (without services installed exec command does work with applications, not with batch files, but they don't run in background, with services the whole exec command does not work)
- put UAC to lowest setting
- Making a test.php:
Result is:
The test.bat file contains:
Same with normal applications. They don't start at all when Apache as services is installed. Only normal applications (no .bat files) run when services is not installed.
I tried changing in services the service can interact with the desktop, no change. I don't know to which user i should change it (the not local one), cause there is none, the user field is blanc.
Can someone help me out? Thnx!
I am really happy with XAMPP, only I just am not able to run any php exec command in the background or at all. So I tried:
- starting XAMPP as admin
- Install services (without services installed exec command does work with applications, not with batch files, but they don't run in background, with services the whole exec command does not work)
- put UAC to lowest setting
- Making a test.php:
- Code: Select all
exec('cmd /c C:/test.bat',$output,$return_val);
if($return_val !== 0) {
echo 'Error<br>';
print_r($output);
}
Result is:
- Code: Select all
Error
Array ( [0] => [1] => C:\xampp\htdocs>echo hoi [2] => hoi [3] => [4] => C:\xampp\htdocs>timeout 5 )
The test.bat file contains:
- Code: Select all
echo hoi
timeout 5
Same with normal applications. They don't start at all when Apache as services is installed. Only normal applications (no .bat files) run when services is not installed.
I tried changing in services the service can interact with the desktop, no change. I don't know to which user i should change it (the not local one), cause there is none, the user field is blanc.
Can someone help me out? Thnx!