note 102627 added to function.apc-bin-dumpfile
[email protected] Thu, 24 Feb 2011 18:50:24 -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.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
----
Server IP: 69.147.83.197
Probable Submitter: 96.3.145.144
----
Manual Page -- http://www.php.net/manual/en/function.apc-bin-dumpfile.php
Edit -- https://master.php.net/note/edit/102627
Del: integrated -- https://master.php.net/note/delete/102627/integrated
Del: useless -- https://master.php.net/note/delete/102627/useless
Del: bad code -- https://master.php.net/note/delete/102627/bad+code
Del: spam -- https://master.php.net/note/delete/102627/spam
Del: non-english -- https://master.php.net/note/delete/102627/non-english
Del: in docs -- https://master.php.net/note/delete/102627/in+docs
Del: other reasons-- https://master.php.net/note/delete/102627
Reject -- https://master.php.net/note/reject/102627
Search -- https://master.php.net/manage/user-notes.php