1、memcached服务安装
#依赖libevent模块 brew install libevent ./configure --prefix=/Users/wenzg/local/memcached --with-libevent=/usr/local/Cellar/libevent/2.0.22/ make && make install
启动服务
/Users/wenzg/local/memcached/bin/memcached -d -m 128 -l 127.0.0.1 -p 9527 -u root #-d 是守护进程模式 #-m 128M #-l 监听服务器ip #-p 监听端口 #-u 以哪个用户的身份运行
测试
telnet localhost 9527 stats
2、memcache扩展安装
php7下安装pecl版本的memcache会报错
./memcache_pool.h:45:10: fatal error: 'ext/standard/php_smart_str_public.h' file not found
wget https://github.com/websupport-sk/pecl-memcache/archive/php7.zip mv php7.zip memcache.zip unzip memcache.zip cd pecl-memcache-php7/ ./configure --with-php-config=/Users/wenzg/local/php/bin/php-config make && make install
php.ini中配置
[memcache] extension_dir = '/Users/wenzg/local/php/lib/php/extensions/no-debug-non-zts-20160303/' extension = 'memcache.so'
让服务生效
测试