Environment:
System: CentOS 6.4 x86_64
PHP version: php5.3.28
I. File download
1. memcache
Memcache website: http://pecl.php.net/package/memcache
Memcache Download: http://down.shshenchu.com/memcache-3.0.8.tgz
II. Installation and configuration
1. Download and install memcache
[Root @ server101 ~] # Cd/usr/local/src // enter the Directory
[Root @ server101 src] # wget http://down.shshenchu.com/memcache-3.0.8.tgz // download the file
[Root @ server101 src] # tar-zxvf memcache-3.0.8.tgz // decompress the file
[Root @ server101 src] # cd memcache-3.0.8 // enter the file directory
[Root @ server101 memcache-3.0.8] #/usr/local/php/bin/phpize // Generate configure file
[Root @ server101 memcache-3.0.8] #./configure -- with-php-config =/usr/local/php/bin/php-config // Generate makefile File
[Root @ server101 memcache-3.0.8] # make-j2 & make install // compile and install
2. Configure the php. Ini file
1) add memcache. so extension
// Add the following content at the end of the php. Ini file
[Memcache]
Extension = memcache. so
2) modify the session configuration
// Modify the parameters as follows:
Session. save_handler = memcache
Session. save_path = "tcp: // 192.168.4.106: 12000"