PDA

View Full Version : ignore_user_abort doesn't work?


xinn
11-28-2007, 11:09 AM
Hello,

i wrote a simply irc-bot in php and it seems that lsws ( or php5.2.4 ) has some problems with ignore_user_abort function. It doesn't actually work... When user clicks "close" button in a browser then he stops a script. I tested the bot on my local environment ( apache 2.0.55, php 5.1.1 ) and it works perfect...

I use lsws 3.3 ent; php 5.2.4 & suExec

mistwang
11-28-2007, 03:30 PM
ignore_user_abort may only work with Apache as Apache embed PHP engine in httpd process. LSWS has no clue whether "ignore_user_about" has been set or not, and the PHP process might be assigned to another request or shutdown.
We will take a closer look, it may not be possible to make it work properly with lsphp.

xinn
11-29-2007, 12:12 AM
is there any possible workaround?

mistwang
11-29-2007, 07:37 AM
We will try, but we cannot guarantee that it will work 100% all the time due to the technical difficult.

mistwang
12-08-2007, 04:32 PM
ignore_user_abort works well when PHP has been started in self-managed mode, that way, LSWS only start one parent process, that parent process will start children process to serve requests. When a request abort, the children process that handles the request will continue till the request has been finished.

So, you need to set "PHP_LSAPI_CHILDREN" env greater than "Max Connections" for the lsphp external app, and "Instances" should be set to "1".