php扩展libzookeeper(https://github.com/timandes/libzookeeper)主要用于使用php代码连接zookeeper集群。
扩展对原Zookeeper C Client(https://zookeeper.apache.org/)的功能进行了简化,强调简单性与易用性。
同时,本着开放的精神,允许更多的参与到Zookeeper的开发与使用当中。
libzookeeper扩展依赖于Zookeeper C Client,后者包含在Zookeeper的安装包中,具体安装方法参看:https://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperProgrammers.html#Installation。
下面介绍libzookeeper的安装步骤(以v0.3.1为例):
立即学习“PHP免费学习笔记(深入)”;
1)下载并解压缩安装包:
wget https://github.com/Timandes/libzookeeper/archive/v0.3.1.tar.gz libzookeeper-0.3.1.tar.gz
tar xvf libzookeeper-0.3.1.tar.gz
2)编译并安装扩展:
cd libzookeeper-0.3.1
phpize
./configure --with-libzookeeper=/path/to/zookeeper_c_client
make
make install
其中,/path/to/zookeeper_c_client代表已安装好的Zookeeper C Client的路径。
3)编辑php.ini,插入如下代码行:
extension=libzookeeper.so
4)如果使用PHP-FPM,则需要重启该服务:
service php-fpm restart
5)检查扩展加载情况:
php -m | grep libzookeeper
在安装过程中出现任何问题,均可以前往https://github.com/Timandes/libzookeeper发问。
Keep是一款健身安排,无论是想减肥塑形或增肌,还是寻找健身跑步瑜伽计步等训练计划,你可以随时随地选择课程进行训练!权威教练视频教学,健身干货自由分享!有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号