tar zxvf libevent-1.4.9-stable.tar.gz
cd libevent-1.4.9-stable
./configure
make
make install
tar zxvf libevent-1.4.9-stable.tar.gz
cd libevent-1.4.9-stable
./configure
make
make install
2.安装memcached
tar zxvf memcached-1.2.6.tar.gz
cd memcached-1.2.6
./configure --enable-threads
make
make install
tar zxvf memcached-1.2.6.tar.gz
cd memcached-1.2.6
./configure --enable-threads
make
make install
注:如果启动时出现“memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open
shared object file: No such file or directory”之类的信息,表示memcached找不到libevent的位置
所以,请先使用whereis libevent得到位置,然后连接到memcached所寻找的路径
[iyunv@localhost tools]# tar zxvf memcached-0.1.4.tgz
[iyunv@localhost tools]# cd memcached-0.1.4
[iyunv@localhost memcached-0.1.4]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached/
[iyunv@localhost memcached-0.1.4]# make
[iyunv@localhost memcached-0.1.4]# make install
[iyunv@localhost tools]# tar zxvf memcached-0.1.4.tgz
[iyunv@localhost tools]# cd memcached-0.1.4
[iyunv@localhost memcached-0.1.4]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached/
[iyunv@localhost memcached-0.1.4]# make
[iyunv@localhost memcached-0.1.4]# make install
修改php.ini添加extension = "memcached.so"就可以了。
1. checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the
prefix where libmemcached headers and library are located
checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix
where libmemcached headers and library are located