Re: Forking PHP on Windows 2003.
nc_at_iname.com
Date: 01/14/05
- Next message: Maja: "problem with PHP_SELF"
- Previous message: Richards Noah \(IFR LIT MET\): "Re: $_SESSION Array"
- In reply to: Hopeless A: "Forking PHP on Windows 2003."
- Next in thread: Hopeless A: "Re: Forking PHP on Windows 2003."
- Reply: Hopeless A: "Re: Forking PHP on Windows 2003."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jan 2005 11:31:51 -0800
Hopeless A wrote:
>
> We are attempting to fork a php script into a background
> php script and have the first scrip continue to completion.
> Is this even possible in the windows version of php?
Yes, if Windows itself allows it. You probably tried something
along the lines of:
exec('start C:\php\cli\php.exe C:\inetpub\wwwroot\background.php');
However, if you type HELP START from your Windows command prompt,
you may notice this bit:
If Command Extensions are enabled, external command
invocation through the command line or the START command
changes as follows:
...
When executing an application that is a 32-bit GUI
application, CMD.EXE does not wait for the application
to terminate before returning to the command prompt.
This new behavior does NOT occur if executing within
a command script.
My guess is that you have Command Extensions enabled, so
forking doesn't work. Try this:
exec('start cmd /E:OFF /C C:\php\cli\php.exe ' .
'C:\inetpub\wwwroot\background.php');
The /E:OFF switch will disable Command Extensions for the
duration of this command-line session, while the /C switch
will make sure the session will terminate after it's
complete...
> We have used the many code snippets floating around
> on the Internet claiming to fork on Windows, yet we
> never get it to work properly, sometimes ending up
> with hunderds of dead php.exe processes on the machine.
Are you sure you are using the correct php.exe? Rememeber,
there are two files named php.exe in PHP distribution,
the CGI executable (usually located in PHP root folder)
and the command-line interpreter (usually located in the
/CLI subfolder)...
Cheers,
NC
- Next message: Maja: "problem with PHP_SELF"
- Previous message: Richards Noah \(IFR LIT MET\): "Re: $_SESSION Array"
- In reply to: Hopeless A: "Forking PHP on Windows 2003."
- Next in thread: Hopeless A: "Re: Forking PHP on Windows 2003."
- Reply: Hopeless A: "Re: Forking PHP on Windows 2003."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|