tags:

views:

39

answers:

2

Hello all,

I have a PHP script that is running and I sometimes just want to restart apache and get rid of all running PHP scripts.

However, I have noticed after my restart, a PHP script will continue running. Why is this? Is there an option to make sure Apache does a proper restart? Or is the ignore_user_abort function causing this issue?

Thanks all for any help

+1  A: 

It depends on how you're restarting httpd. A "soft restart" (e.g. killall -HUP httpd) allows currently-running httpd children to complete the request before dying. This eliminates occurrences of the browser just "dying" during a request, but it does mean that currently-running PHP scripts (since they run in the httpd child) will continue to run.

Ignacio Vazquez-Abrams
A: 

PHP scripts can also be started from CLI si they run in background and do varios work. Those are not managed by apache, you have to manage them individually.

ignore_user_abort only ignores the user, you cannot really ignore the server shutddown:) unless you aren't really shutting down but just reloading configs, as Ignacio said above

Quamis