The first thing to note is the difference between memcache and memcached. memcache is a client extension and memcached is a server. 1. install the libmemcached Library [root @ bl
The first thing to note is the difference between memcache and memcached. memcache is a client extension and memcached is a server.
1. install the libmemcached Library
|
[Root@blog.phpha.com] yum install libmemcached |
2. install Memcache extension in PHP
|
[Root@blog.phpha.com] wget-c http://pecl.php.net/get/memcache-3.0.8.tgz?root@blog.phpha.com] tar-zxvf memcache-3.0.8.tgz [root@blog.phpha.com] cd memcache-3.0.8 [root@blog.phpha.com]/usr/local/php/bin/phpize [root@blog.phpha.com] /configure -- with-php-config =/usr/local/php/bin/php-config -- enable-memcache -- with-zlib-dir [root@blog.phpha.com] make & make install/ usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/memcache. also [root@blog.phpha.com] vim/usr/local/php/etc/php. iniextension =/usr/local/php/lib/php/extension/ no-debug-non-zts-20090626/memcache. sosession. save_handler = memcachesession. save_path = "tcp: // 127.0.0.100: 11211" [root@blog.phpha.com] service php-fpm reload |
Supplement: This article introduces the PHP Memcache extension installation, that is, the client installation. After the installation, a problem is found, and the SESSION is lost. when the Memcached server is installed, no port 11211 is added to the firewall. after the firewall rules are modified, everything is normal.