Ubuntu – Not able to install PECL for php 7.3 in ubuntu 20.04 LTS

PHPphp7Ubuntu

I have a laravel project that uses firebase and I am not able to install PECL for php7.3. I tried this https://cloud.google.com/php/grpc. When I tried the following command

sudo apt-get install autoconf zlib1g-dev php-dev php-pear

it doesn't install Packages for 7.3 but for 8.0 which is not my requirement. I also tried.

sudo apt-get install autoconf zlib1g-dev php7.3-dev php7.3-pear

But it says it cannot locate the package for 7.3 (E: Unable to locate package php7.3-pear)

Best Answer

Ubuntu 20.04 main repositories support PHP 7.4.

To install 7.3, you will need to use a different source, such as the popular PPA by Ondřej Surý.

$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install autoconf zlib1g-dev php7.3-dev php-pear