mac安装php-zookeeper扩展

1.下载zookeeper:http://mirror.bit.edu.cn/apache/zookeeper/  解压到usr/local下

2.复制配置文件:cp /usr/local/zookeeper/conf/zoo_sample.cfg /usr/local/zookeeper/conf/zoo.cfg

3.编译:进入目录——cd zookeeper-3.4.9/src/c

  执行:./configure -prefix=/usr/local/zookeeper/zookeeper-3.4.9/

  执行:make && make install

安装php zookeeper 扩展

1.下载扩展包:http://pecl.php.net/get/zookeeper-0.2.2.tgz  解压到usr/local

2.进入zookeeper目录里:cd zookeeper-0.2.2  (备注:里面有两层,进到最里层)

3.执行phpize (如果提示:phpize:Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF 。则操作第四步否则跳过第四步)

4.安装autoconf:

curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz

tar xzf autoconf-latest.tar.gz

cd autoconf-*

./configure --prefix=/usr/local

make

sudo make install

5.编译扩展(注意php-config 和zookeeper路径):

./configure --with-php-config=/usr/local/php5/bin/php-config  --with-libzookeeper-dir=/usr/local/zookeeper/zookeeper/ 

安装成功会输出:Installing shared extensions:模块目录

6.

三、配置php.ini

在最后添加:extension=zookeeper.so

phpinfo()查看扩展是否起效,若没有则修改php.ini中的extension_dir,配置为模块目录

你可能感兴趣的:(mac安装php-zookeeper扩展)