Page 1 of 1

php exec and black window

PostPosted: 31. January 2007 19:10
by mikey__
Hi,

using xampp + php as per the default install.

Trying to run a command line program using exec. Actually I have no
problem running the program, but nothing I do seems to stop it
briefly showing a black window for the process.

I've read a lot of discussion of this suggesting things like "start /b"
and "cmd /c", but nothing seems to make any difference.

The command lookds like

Code: Select all
exec("start /b c:/stuff/prog.exe < file.in > file.out 2> nul", $output);

prog.exe does not open any windows itself, but I always get the black
window appear and then disappear. The program runs correctly
each time it is executed.

Can anyone shed any authoritative light on this?

A few web articles suggested using php-win.exe for running php within
xampp, but I cannot figure out how to change this.

Many thanks for your help.

Mike

PostPosted: 31. January 2007 19:58
by Wiedmann
Actually I have no
problem running the program, but nothing I do seems to stop it
briefly showing a black window for the process.

Install and start Apache as Windows service.

Problem solved!

PostPosted: 31. January 2007 20:08
by mikey__
Thank you soooooo much! :D

I just checked the svc button and restarted it and bam! no black
windows.

Is it possible to summarize what difference this makes to how
xampp/php works?

If not, no problem, you've saved my afternoon...

Mike