ENV
- php 7.x
- mac osx
編譯好的 memcache.so
- github : https://github.com/majksner/php-memcached-mamp
- 下載 memcached.so
- brew install memcached
- brew install libmemcached
- php –ini
- vim php.ini
- extension=memcached.so
-
php -i grep memcached
自己 compile
- git clone https://github.com/php-memcached-dev/php-memcached.git
- brew install memcached
- brew install libmemcached
- git checkout php7
- phpize
./configure --with-memcached=/usr/local/Cellar/libmemcached/1.0.18_1/lib/libmemcached
- Notice : the
libmemcached
path is brew install path
- Notice : the
- make
- sudo make install
- mv memcached.so to extension path, you could get path with
php -i | grep extension_dir
- vim php.ini, add
extension=memcached.so
如何使用
前提
- 安裝好 memcached 在電腦中 : brew install memcached
- 至於 libmemcached 則為編譯成 .so 時使用
- 執行 memcached 即可
man memcached
-memcached -l 127.0.0.1 -P 11211 -m 128 -d
: for deamon -memcached -l 127.0.0.1 -P 11211 -m 128 -vv
: for debug
- 檢查 memcached 是否有執行 :
ps aux | grep memcached
判斷 php 是否安裝好支援的 memcached.so
php -i | grep memcached |
php -m | grep memcached |
test
1 |
|
console admin
git@github.com:jhaoheng/phpmemcacheadmin.git