PDO driver loses variables on Apache termination

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
harrym
Forum Newbie
Posts: 7
Joined: Thu Oct 29, 2009 11:01 am

PDO driver loses variables on Apache termination

Post 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 ?
Post Reply