Php – How to install PECL when using PHP5.6 from http://ppa.launchpad.net/ondrej/php/ubuntu

pearpeclPHPubuntu-18.04

I've installed PHP 5.6 from the PPA http://ppa.launchpad.net/ondrej/php/ubuntu.

All the packages are called php5.6-whatever.

There is no php5.6-pear in that PPA.

How can I install php5.6-pear?

Best Answer

I had the same problem. Installing php5.6-dev package and adjusting the default php binaries like described in https://github.com/oerdnj/deb.sury.org/wiki/PECL-Installation did it for me:

apt-get install php5.6-dev
update-alternatives --set php /usr/bin/php5.6
update-alternatives --set php-config /usr/bin/php-config5.6
update-alternatives --set phpize /usr/bin/phpize5.6

Then it will work like expected:

pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
Related Topic