How to install PHP extension libzookeeper (https://github.com/Timandes/libzookeeper) is mainly used to connect to the Zookeeper cluster using PHP code.
The expansion simplifies the functionality of the original Zookeeper C Client (https://zookeeper.apache.org/), emphasizing simplicity and ease of use.
At the same time, in the spirit of openness, more people are allowed to participate in the development and use of Zookeeper.
The libzookeeper extension depends on the Zookeeper C Client, which is included in the Zookeeper installation package. for the installation method, see https://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperprogrammers.html.
The following describes how to install libzookeeper (v0.3.1 is used as an example ):
1) Download and decompress 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 extensions:
Cd libzookeeper-0.3.1
Phpize
./Configure -- with-libzookeeper =/path/to/zookeeper_c_client
Make
Make install
Here,/path/to/zookeeper_c_client represents the path of the Zookeeper C Client that has been installed.
3) edit php. ini and insert the following code line:
Extension = libzookeeper. so
4) If you are using a PHP-FPM, you need to restart the service:
Service php-fpm restart
5) Check the scaling load:
Php-m | grep libzookeeper
If you encounter any problems during the installation, go to https://github.com/timandes/libzookeeperto ask.