The installation department of Aliyun Ubuntu OCS under installed Memcache is as follows:
1.apt-get installation Php5-dev Libsasl2-dev CLOOG-PPL
sudo apt-get install Php5-dev libsasl2-dev cloog-ppl
2. Install libmemcached (must be the following version)
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
Tar zxvf libmemcached-1.0.16.tar.gz
CD libmemcached-1.0.16
./configure--prefix=/usr/local/libmemcached
Make make install; Make clean
Cd..
3. Installation process memcached (must be the following version)
wget http://pecl.php.net/get/memcached-2.1.0.tgz
Tar zxvf memcached-2.1.0.tgz
CD memcached-2.1.0
Phpize5
./configure--with-libmemcached-dir=/usr/local/libmemcached--ENABLE-MEMCACHED-SASL
Make make install; Make clean
4. Configure PHP support Memcache
echo "Extension=memcached.so" >>/etc/php5/conf.d/pdo.ini
echo "MEMCACHED.USE_SASL = 1" >>/etc/php5/conf.d/pdo.ini
5. See if the installation is successful
Php-m |grep Mem
6. Restart Apache
Service Apache2 Restart
7. Test
$connect = new Memcached;
$connect->setoption (Memcached::opt_compression, false);
$connect->setoption (Memcached::opt_binary_protocol, true);
$connect->addserver (' host ', port);
$connect->setsaslauthdata (' username ', ' password ');
$connect->set ("Hello", "World");
echo ' Hello: ', $connect->get ("Hello");
$connect->quit ();
?>