Update the installed packages.
apt update
Install the Ondřej PHP repository.
apt install software-properties-commonsudo
add-apt-repository ppa:ondrej/php
apt update
Check that the repositories are correctly installed.
grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*
In this case, PHP 7.0 and 7.1 will be installed
# PHP 7.0
apt-get install php7.0 php7.0-cli php7.0-dev php7.0-intl
# PHP 7.1
apt-get install php7.1 php7.1-cli php7.1-dev php7.0-intl
yum install php-pear
pecl channel-update pecl.php.net
apt-get install libyaz-dev
Set which version to use when compiling the extensions.
# PHP 7.0
pear config-set php_bin "/usr/lib/cgi-bin/php7.0"
# PHP 7.1
pear config-set php_bin "/usr/lib/cgi-bin/php7.1"
Force an upgrade to save changes.
pear upgrade --force
Use the following command to choose the PHP version to be used as an alternative.
update-alternatives --config php-config
pecl install yaz
Use the following command to find where the extension was installed.
pear config-show | grep ext_dir
If necessary, move the extension to the correct PHP extension folder and add the extension to the corresponding php.ini file.
extension=yaz.so
/etc/init.d/apache2 reload
- https://pecl.php.net/package/yaz
- https://www.php.net/manual/en/install.pecl.pear.php
- https://www.php.net/manual/en/install.pecl.phpize.php
- https://forum.centos-webpanel.com/php/how-to-add-yaz-extension-to-php/
- https://kence.org/2016/06/07/installing-yaz-for-php-on-ubuntu/
- https://pear.php.net/manual/en/guide.users.commandline.config.php