PHP extension Libzookeeper (https://github.com/Timandes/libzookeeper) is primarily used to connect zookeeper clusters using PHP code.
The extension simplifies the functionality of the original zookeeper C Client (https://zookeeper.apache.org/), emphasizing simplicity and ease of use.
At the same time, the spirit of openness, allowing more participation in the development and use of zookeeper.
The libzookeeper extension relies on the zookeeper C Client, which is included in the Zookeeper installation package, as described in the installation method: https://zookeeper.apache.org/doc/r3.5.0-alpha/ Zookeeperprogrammers.html#installation.
The installation steps for Libzookeeper are described below (for example, v0.3.1):
1) Download and unzip the installation package:
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) Compile and install the extension:
CD libzookeeper-0.3.1
Phpize
./configure--with-libzookeeper=/path/to/zookeeper_c_client
Make
Make install
Where/path/to/zookeeper_c_client represents the path of the installed Zookeeper C client.
3) Edit the php.ini and insert the following line of code:
Extension=libzookeeper.so
4) If you are using PHP-FPM, you will need to restart the service:
Service PHP-FPM Restart
5) Check the extended load:
php-m | grep libzookeeper
You can go to Https://github.com/Timandes/libzookeeper to ask questions during the installation process.
How to install PHP extensions Libzookeeper