note 102627 modified in function.apc-bin-dumpfile by danbrown

From: Date: Fri, 25 Feb 2011 14:34:00 +0000
Subject: note 102627 modified in function.apc-bin-dumpfile by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177330@lists.php.net to get a copy of this message
To prevent losing all of your APC custom user data on an apache restart, use this function along with apc_bin_loadfile to save your APC Memory Data on a restart of apache. e.g. Write a php script to dump the file and one to re-load the file. Call the dump script directly before stopping apache, and then call the reload script directly after starting apache. <?php //saveapc apc_bin_dumpfile(array(),null,"/path/to/my/file.data"); ?> <?php //loadapc apc_bin_loadfile("/path/to/my/file.data"); ?> # wget http://www.example.com/saveapc.php # /etc/init.d/httpd restart # wget http://www.example.com/loadapc.php Particularly useful if you have a custom session handler using APC for storage Even more handy, update the httpd restart bash script to automatically make these calls for you on a restart --was-- To prevent losing all of your APC custom user data on an apache restart, use this function along with apc_bin_loadfile to save your APC Memory Data on a restart of apache. e.g. Write a php script to dump the file and one to re-load the file. Call the dump script directly before stopping apache, and then call the reload script directly after starting apache. <?php //saveapc apc_bin_dumpfile(array(),null,"/path/to/my/file.data"); ?> <?php //loadapc apc_bin_loadfile("/path/to/my/file.data"); ?> # wget http://www.mywebserver.com/saveapc.php # /etc/init.d/httpd restart # wget http://www.mywebserver.com/loadapc.php Particularly useful if you have a custom session handler using APC for storage Even more handy, update the httpd restart bash script to automatically make these calls for you on a restart http://php.net/manual/en/function.apc-bin-dumpfile.php

« previous php.notes (#177330) next »