note 108308 deleted from apc.configuration by thiago
| From: | thiago@php.net | Date: | Tue, 17 Apr 2012 05:05:11 +0000 |
| Subject: | note 108308 deleted from apc.configuration by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187195@lists.php.net to get a copy of this message | ||
Note Submitter: Bas Vijfwinkel
----
I did some digging how to use the apc.preload_path settings works.
The bad news is that for the current version it seems to be broken, but that will hopefully be fixed
soon.
If you can compile apc yourself (phpize->configure->make), you need to apply the following fix
:
- open the source file apc_main.c
- search for the function : apc_load_data
- change p = strrchr(key, '.'); into p = strrchr(key, '.')+1;
- compile the source and copy the apc.so file to correct folder.
If you assign a valid path to this setting, APC will move the contents of the files to the user
entry cache.
The files need to have the extension '.data' and the filename part will be the key of the
APC entry, e.g "mykey.data"
The contents needs to be the serialized string of the desired output. if you just
echo(serialize(<contents>)) you will be show the correct format.
For example a string 'test' will be s:4:"test";
(the semicolon is needed)
If Apache starts, APC will look in the specified folder and will create a key called
'mykey' that contains the contents "test".
If the files you create do not have the '.data' extension they will be ignored as well as
file that have no valid contents.
apc.preload_path cannot be used for preloading PHP scripts you would like to use.
To precompile PHP files to be stored in APC, you need to create a script yourself and use
'apc_compile_file' to load all desired files to APC. You need to run this after the
webserver has started.