#wget http://memcached.googlecode.com/files/memcached-1.4.10.tar.gz #tar -zxvf memcached-1.4.10.tar.gz #cd memcached-1.4.10 #./configure --prefix=/usr/local/webserver/memcached --with-libevent=/usr/ #make #make install或
yum install -y memcached
#/usr/local/webserver/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root -P /tmp/memcached.pid无提示则启动成功
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT重启防火墙service iptables restart;
yum install -y php-pecl-memcache
最后重启service httpd restart
<session_save><![CDATA[memcache]]></session_save> <session_save_path><![CDATA[tcp://10.10.10.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]></session_save_path> <cache> <backend>memcached</backend> <memcached> <servers> <server> <host><![CDATA[10.10.10.1]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> </server> </servers> <compression><![CDATA[0]]></compression> <cache_dir><![CDATA[]]></cache_dir> <hashed_directory_level><![CDATA[]]></hashed_directory_level> <hashed_directory_umask><![CDATA[]]></hashed_directory_umask> <file_name_prefix><![CDATA[]]></file_name_prefix> </memcached> </cache>