Check for the installation using:
php -r 'phpinfo();' |grep apc If its not installed already use(on ubuntu): sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart or apt-get install apache2-prefork-dev
pecl install apc Use dpkg -L php-apc to know where the files are installedThere are two primary decisions to be made configuring APC. First, how much memory is going to be allocated to APC; and second, whether APC will check if a file has been modified on every request. The two ini directives that control these settings are apc.shm_size and apc.stat, respectively. Read the sections on these two directive carefully below.
APC Functions
Table of Contents
- apc_add — Cache a variable in the data store
- apc_cache_info — Retrieves cached information from APC's data store
- apc_clear_cache — Clears the APC cache
- apc_compile_file — Stores a file in the bytecode cache, bypassing all filters.
- apc_define_constants — Defines a set of constants for retrieval and mass-definition
- apc_delete — Removes a stored variable from the cache
- apc_fetch — Fetch a stored variable from the cache
- apc_load_constants — Loads a set of constants from the cache
- apc_sma_info — Retrieves APC's Shared Memory Allocation information
- apc_store — Cache a variable in the data store
1)$bar = 'BAR';apc_store('foo', $bar);var_dump(apc_fetch('foo'));?> outputs : BAR 2)
$constants = array(
'ONE' => 1,
'TWO' => 2,
'THREE' => 3,
);apc_define_constants('numbers', $constants);
echo ONE, TWO, THREE;?> From :php.net/apc
No comments:
Post a Comment