The simplest method is to find the PECL in the PHP installation directory.
Automatic installation:
#/Usr/local/PHP/bin/PECL install APC
Follow the prompts below to complete step by step
Configuration/Etc/PHP. iniAdd at the end
Extension = APC. So
Manual installation:
Official http://cn2.php.net/manual/zh/book.apc.php
Download the http://pecl.php.net/package/APC to find the latest
# Wget http://pecl.php.net/get/APC-3.1.9.tgz
# Tar-zxvf APC-3.1.9.tgz
# Cd APC-3.1.9
#/Usr/local/PHP/bin/phpize (production of configure files)
#./Configure-enable-APC-MMAP-with-PHP-Config =/usr/local/PHP/bin/PHP-config
# Make
# Make install
Copy and add an so file
# Cp/usr/local/lib/PHP/extensions/no-debug-zts-20060613/APC. So/usr/local/PHP/lib/PHP/extensions/APC. So
# Chmod 755/usr/local/PHP/lib/PHP/extensions/APC. So
Modify PHP. ini to enable the APC Module
Modify PHP. ini
Extension_dir = "./"
Extension_dir = "/usr/local/PHP/lib/PHP/extensions"
Add/etc/PHP. ini to the end
Extension = APC. So
APC. Enabled = 1
APC. cache_by_default = on
APC. shm_segments = 1
APC. shm_size = 128
APC. TTL = 7200
APC. user_ttl = 7200
APC. num_files_hint = 1024
APC. write_lock = on
APC. gc_ttl = 3600
APC. TTL = 0
APC. mmap_file_mask =/tmp/APC. xxxxxx
Restart Apache
#/Usr/local/apache2/bin/apachectl restart
Use APC
<? PHP
Print_r (apc_cache_info ());
?>
note that the browser is not very friendly. You can view the Source Code Of the webpage to see it clearly.
Array ([num_slots] => 1031 [TTL] => 0 [num_hits] => 4 [num_misses] => 1 [num_inserts] => 1 [expunges] => 0 [start_time] ==> 1322818377 [mem_size] => 4240 [num_entries] => 1 [file_upload_progress] => 1 [memory_type] => MMAP [locking_type] => spin locks [cache_list] => array ([0] => array ([type] => file [device] => 2049 [inode] => 883230 [filename] =>/var/www/TB. PHP [num_hits] => 4 [mtime] => 1322818340 [creation_time] => 1322818379 [deletion_time] => 0 [access_time] => 1322818482 [ref_count] => 1 [mem_size] => 4240 )) [deleted_list] => array () [slot_distribution] => array (
......
Multiple clicks can be foundNum_hitsThe cache is hit!
Stress TestingView results:
How to perform stress testingArticleHttp://blog.csdn.net/21aspnet/article/details/6595984
First, check to disable the APC function and configure it in PHP. ini.
# AB-n1000-C10Http: // localhost/TB. php
At this time, the throughput of requests per second is much higher than before.
============
Several other PHP cache tools
Xcache
Http://xcache.lighttpd.net/
Eaccelerator
http://sourceforge.net/projects/eaccelerator/