Page 1 of 1

PDO driver loses variables on Apache termination

Posted: Thu Aug 05, 2010 9:38 am
by harrym
We have a PDO driver that is loaded into PHP as a shared-library module.
It works well, but we experience a strange behavior when stopping Apache.

Our PDO driver uses global static variables to track information which is required for orderly shutdown.
However, when Apache is stopped, although the PHP_MSHUTDOWN_FUNCTION is called as it should, all global variables are reinitialized to zero.

It seems like our module was reloaded into the Apache server process, and so all its global variables were reinitialized and lost.

Can somebody explain what's going on and how to avoid this problem of lost global data ?