Install PHP zookeeper On CentOS from source
Install PHP zookeeper On CentOS from source
.
The latest version of PHP zookeeper (stable, alpha and beta) can be downloaded from the below URL.
https://pecl.php.net/get/zookeeper
Before installing PHP zookeeper you must install libzookeeper-devel and libzookeeper on your Linux server. You can download and install the rpm of these packages by searching in google.
Do the below steps to PHP Zookeeper extension from source.
1. First go to /usr/local/src directory
[root@server src]#
0.5.0 is the latest stable release (release date : 2018-05-14, File size: 26.2kB)
--2019-01-07 16:24:01-- https://pecl.php.net/get/zookeeper-0.5.0.tgz
Resolving pecl.php.net (pecl.php.net)... 104.236.228.160
Connecting to pecl.php.net (pecl.php.net)|104.236.228.160|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26780 (26K) [application/octet-stream]
Saving to: 'zookeeper-0.5.0.tgz.1'
100%[===============================>] 26,780 --.-K/s in 0.01s
2019-01-07 16:24:01 (1.74 MB/s) - 'zookeeper-0.5.0.tgz' saved [26780/26780]
3. Untar zookeeper-0.5.0.tgz file after download is completed
Run the command ‘tar xvzf zookeeper-0.5.0.tgz’ to extract
zookeeper-0.5.0/examples/Zookeeper_Example.php
zookeeper-0.5.0/examples/watch.php
zookeeper-0.5.0/README.markdown
zookeeper-0.5.0/CREDITS
zookeeper-0.5.0/LICENSE
zookeeper-0.5.0/ChangeLog
zookeeper-0.5.0/zookeeper-api.php
zookeeper-0.5.0/config.m4
zookeeper-0.5.0/php_zookeeper.c
zookeeper-0.5.0/php_zookeeper.h
zookeeper-0.5.0/php_zookeeper_private.h
zookeeper-0.5.0/php_zookeeper_session.c
zookeeper-0.5.0/php_zookeeper_session.h
zookeeper-0.5.0/zoo_lock.c
zookeeper-0.5.0/zoo_lock.h
zookeeper-0.5.0/php5to7.h
zookeeper-0.5.0/php_zookeeper_exceptions.c
zookeeper-0.5.0/php_zookeeper_exceptions.h
zookeeper-0.5.0/zookeeper34to35.h
[root@server zookeeper-0.5.0]#
[root@server zookeeper-0.5.0]# phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Run configure with --with-libzookeeper-dir=[Zookeeper-C-Binding-directory]
If you see the below error, then search for exact location of zookeeper.h on your server.
configure: error: Can't find zookeeper headers
# locate zookeeper.h
/usr/include/zookeeper/zookeeper.h
Installing shared extensions: /usr/lib64/php/modules/
Run the command ‘php -i | grep php.ini’ OR ‘php --ini’ to find the location of your loaded PHP configuration file.
On my centOS server, the php configuration file is in path /etc/php.ini. Open the php.ini file using vi editor and add ‘extension=zookeeper.so’ to the end. Save the file and exit.
9. Run the below command to make sure PHP zookeeper extension is enabled
zookeeper