note 102627 modified in function.apc-bin-dumpfile by danbrown
[email protected] Fri, 25 Feb 2011 06:34:00 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
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