PHP memcache和memcached高速缓存模块
更新:HHH   时间:2023-1-7


安装PHP的MEMCACHE扩展

下载http://pecl.php.net/package/memcache

tar -zxvf memcache-3.0.8.tgz

cd memcache-3.0.8.tgz

/usr/bin/phpize

./configure --enable-memcache

make && make install

显示完成:Installing shared extensions:     /usr/lib/php/modules/

添加php扩展文件

vim /etc/php.ini

extension=memcache.so

安装PHP的MEMCACHED扩展

下载https://launchpad.net/libmemcached/+download

下载http://pecl.php.net/package/memcached

tar -zxvf libmemcached-1.0.18.tar.gz

cd libmemcached-1.0.18.tar.gz

mkdir /usr/local/share/libmemcached

./configure --prefix=/usr/local/share/libmemcached

make && make install

tar -zxvf memcached-2.2.0.tgz

cd memcached-2.2.0.tgz

/usr/bin/phpize

./configure --with-libmemcached-dir=/usr/local/share/libmemcached/

make && make install

添加php扩展文件

vim /etc/php.ini

extension=memcached.so

重启nginx

service nginx restart 就可以看到memcache扩展模块了


返回web开发教程...