tags:

views:

48

answers:

2

I am trying to invoke external program (in my case IECapt.exe) in php function exec() on windows.

It works well most of the time, but when IECapt.exe crash, windows pop-up a crash prompt window,

and php script hangs there wait this prompt window closed, so how to disable such pop-up crash window?

because my php script need run as a daemon, and not expected paused when this happens.

how to make it just quit when crash?

thanks for your suggestions.

A: 

From php.net:

If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.

Not sure if this works, but you could try:

exec('IECapt.exe > output.txt');
captaintokyo
Windows Error Reporting has nothing to do with stdout, so I can't imagine that this would make any difference.
Joe White
A: 

Set an exception filter via SetUnhandledExceptionFilter that calls TerminateProcess.

Paul Betts