Re: external program execution

From: Date: Tue, 20 Aug 2002 01:35:59 +0000
Subject: Re: external program execution
References: 1 2 3 4  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-2347@lists.php.net to get a copy of this message
|having looked throught the user comments on www.php.net/exec This one is probably a good hint.. (In addition to an older comment) I had the requirement to start a program from a php cli-script with a low priority (to run for hours in the background). I found this to be working fine: $res=exec("start /low /b /wait identify.exe -format \"%w %h %m\" \"".$file."\"");| regards alan Gabor Hojtsy wrote:
threading - but that in my talk :) have you tried popen('someapp &','w'); ??
     
This does not help... I also tried to wrap that app around with a batch file, or PHP itself: popen('php start.php &', 'w'); But that also only runs after PHP-GTK quits. ;(( The strange thing is that all things work in command line scripts, and that script does end the execution before the external app is closed... <?php // Produces the exact same effect with // system() or `` or popen() exec("start http://localhost/"); for ($i = 0; $i < 8; $i++) { sleep(1); } ?> This script does show that page with my default browser and it does quit after exactly 8 seconds, while I can browse my local page. Why doesn't that work in PHP-GTK? It should be the same... :((
So does that mean that I need to use pcntl_fork() if it's non-Windows, and use some COM/Win32 DLL call if it's Windows? That's quite ugly... But may work... Goba


« previous php.gtk.general (#2347) next »