Installation Instructions For APCu
Installation Instructions For APCu
You will probably need to run the final command (make install) as root.
The above sequence of commands will install a .so file in your PHP
installation extension directory. The output of make install should display
that path to the screen.
Next you must edit your php.ini file, which is normally located in
/usr/local/php/lib/php.ini, and add the following line:
extension="apcu.so"
Replace "/path/to/php/extensions" with whatever path was displayed when you
ran make install above.
Then restart your web server and consult the output of phpinfo(). If there is
an informational section for APCu, the installation was successful.
+------------------------+
| QUICK INSTALL (Static) |
+------------------------+
APCu will not successfully compile on all systems as a DSO. If you run into
problems using the DSO quick install, you can try to compile it statically
into PHP. (The DSO install is recommended, though.)
These instructions assume the current directory is the root of the PHP source
tree, and that you have already configured PHP by running its bundled
configure script.
$
$
$
$
$
$
$
cd ext
gunzip -c apcu_x.y.tar.gz | tar xf cd ..
./buildconf
./config.nice
make
make install
Once this is complete, simply restart your web server. You do not need to
modify your php.ini file to enable APCu.
+-----------------+
| VERBOSE INSTALL |
+-----------------+
These instructions assume your PHP installation is located in /usr/local/php.
1. Unpack your distribution file.
You will have downloaded a file named something like apcu_x.y.tar.gz.
Unzip this file with a command like
gunzip apcu_x.y.tar.gz
Next you have to untar it with
tar xvf apcu_x.y.tar
This will create an apcu_x.y directory. cd into this new directory:
cd apcu_x.y
2. Run phpize.
phpize is a script that should have been installed with PHP, and is
normally located in /usr/local/php/bin assuming you installed PHP in
/usr/local/php. (If you do not have the phpize script, you must reinstall
PHP and be sure not to disable PEAR.)
Run the phpize command:
/usr/local/php/bin/phpize
Its output should resemble this:
+------------------+
| CONFIGURING APCu |
+------------------+
OPTION
-----------------apc.enabled
apc.enable_cli
les APCu
DESCRIPTION
-------------------------------------------------This can be set to 0 to disable APCu. This is
primarily useful when APCu is statically compiled
into PHP, since there is no other way to disable
it (when compiled as a DSO, the extension
line can just be commented-out).
(Default: 1)
Mostly for testing and debugging. Setting this enab
for the CLI version of PHP. Normally you wouldn't w
ant to
create, populate and tear down the APCu cache on eve
ry CLI
request, but for various test scenarios it is handy
to be
able to enable APCu for the CLI version of APCu easi
ly.
(Default: 0)
apc.preload_path
d
from disk upon intiialization of APCu.
preload_path should be a directory where each file f
ollows
$key.data
where $key should be used as the entry name and the
contents
of the file contains serialized data to use as the v
alue of
the entry.
(Default: null)
apc.shm_size
apc.shm_segments
apc.ttl
(Default: 0)
apc.gc_ttl
apc.smart
rces, an expunge of the cache
y
region is going to be file-backed or shared memory
backed. For straight file-backed mmap, set it to
something like /tmp/apc.XXXXXX (exactly 6 X's).
To use POSIX-style shm_open/mmap put a ".shm"
somewhere in your mask. eg. "/apc.shm.XXXXXX"
You can also set it to "/dev/zero" to use your
kernel's /dev/zero interface to anonymous mmap'ed
memory. Leaving it undefined will force an
anonymous mmap.
(Default: "")
apc.slam_defense
r
modify files you can create a race of many processes
all trying to cache the same data at the same time.
By default, APCu attempts to prevent "slamming" of a
key.
A key is considered "slammed" if it was the last key
set,
and a context other than the current one set it ( ie
. it
was set by another proce
ss or thread )
Note:
APCu does not st
ore enough information to
catch every occu
rence, sufficient none the less.
(Default: 1)
apc.serializer
Default is the
aving
to re compile apc, like igbinary for example.
(apc.serializer=igbinary)
/* The remaining entries concern file upload progress support */
apc.rfc1867
ailable
en enabled
any file uploads which includes a field called
APCu_UPLOAD_PROGRESS before the file field in an upl
oad form
will cause APCu to automatically create an upload_<k
ey>
user cache entry where <key> is the value of the
APCu_UPLOAD_PROGRESS form entry.
Note that the file upload tracking is not threadsafe
at this
point, so new uploads that happen while a previous o
ne is
still going will disable the tracking for the previo
us.
(Default: 0)
apc.rfc1867_prefix
by
rfc1867 upload progress functionality.
(Default: "upload_")
apc.rfc1867_name
Cu upload
apc.rfc1867_freq
r cache
f a
percentage of the total file size or a size in bytes
optionally suffixed with 'k', 'm', or 'g' for kiloby
tes,
megabytes, or gigabytes respectively (case insensiti
ve).
A setting of 0 updates as often as possible, which m
ay cause
slower uploads.
(Default: 0)