Hi Jochen,

I had grief with background processes in Windows a while back, the 
solution was to use popen() to call the 'start /B' command.

Code is like:
function background_exec($command)
{
    if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
    {
        pclose(popen('start /B ' . $command, "r"));
    }
    else
    {
      $command =  $command . ' > /dev/null 2>&1 &';
      exec($command);
    }
}

This allows any command in $command to run as a background process. This 
means PHP does NOT wait for execution.

I don't know if this helps at all. I was doing image conversion also, 
and due to the large size of the images background processing was desirable.

Cheers,
Stig

Jochen Daum wrote:
> I'm stuck with running exec() on a win2003 server with Apache2
> installed. The command runs Irfanview to do an image conversion and
> exec() returns 1. However nothing happens. Pasting it into a command
> line box works fine. I can't find any errors in the Event Log, nor
> php.log. I've also tried the live.sysinternals.com procmon.exe
> program, but there seems to be nothing happening in regards to exec().
> Have also checked that exec() is not a disabled function.
>
> Any idea where to dig next?
>
>   


-- 
Stig Manning
http://www.sdm.co.nz


--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to