Total Pageviews

Thursday, 21 January 2016

How to install Yaz PHP on CentOs 6


YAZ is a programmers’ toolkit supporting the development of Z39.50/SRW/SRU clients and servers. We first need to install YAZ dependencies using the yum package manager.
# yum install libicu libicu-devel libxml2
We also need to install "libiconv" manually as it's not available in the repository. Simply download the latest version of the package and compile and install it.
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
# cd libiconv-1.14
# ./configure --prefix=/usr/local
# make
# make install
Now let's download the latest version of the YAZ and compile and install it.
# wget http://ftp.indexdata.dk/pub/yaz/yaz-5.3.0.tar.gz
# tar xvzf yaz-5.3.0.tar.gz
# cd yaz-5.3.0
# ./configure --with-xml2 --with-iconv --with-icu --with-xslt --without-openssl
# make 
# make install
Great! We have YAZ install on the system. Let's find the "pecl" package manager executable file location and install the PHP YAZ package using it.
# find / -name "pecl"
/usr/local/bin/pecl

# /usr/local/bin/pecl install yaz
...
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/yaz.so'
install ok: channel://pecl.php.net/yaz-1.1.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=yaz.so" to php.ini
As the the instalation last message says we should add this line to php.ini and restart the web server so the changes get picked up.
extension=/usr/local/lib/php/extensions/no-debug-non-zts-20090626/yaz.so
And here is the reference to PHP YAZ functions in case you need it.