|
Posted by a on 10/12/29 11:39
I already posted on this subject, but I have some more information that
should make the issue clearer.
Config: Apache 2.x, PHP 5.1.x, Windows XP Pro
A php script processes a form. Inside this script I call exec to run a
Windows process. If I press the submit button on the form repeatedly, exec
starts and exit the process several times, but after 2-3 cycles, it starts
the process, the process exits, but exec doesn't return, and it hangs the
script and the session forever - it won't even timeout.
I tried to block multiple POSTs by using a global var:
if( isset( $_SESSION[ "processing" ] ) )
{
// 1
exit;
}
else
{
$_SESSION[ "processing" ] = true;
exec( ...);
unset( _SESSION[ "processing" ] );
}
but the script never reaches //1.
I am totally confused by this reentrancy issue and I don't know how to
handle:
1. multiple posts while the script is still running, to avoid hanging the
session
2. offering the ability to cancel the processing, if the process takes a
long time.
One of the requirements is that all processing happen on the server, so no
JavaScript is allowed.
A related question - can multiple php scripts run simultaneously in the same
session -if a user presses submit multiple times, does this run new instance
of the script for each POST?
I would really appreciate any help.
Thanks,
A
Navigation:
[Reply to this message]
|