Ubuntu 20.04.2 PHP Error while pecl install
Solution 1:
-
If it says: "No releases available for package ...", you will need to install php-dev package to get the necessary PHP5 source files to compile additional modules.
Run
apt-get install php-dev
You can specify specific version:
apt-get install php8.0-dev
-
If you see "make: not found", you need to have
make
installedRun
sudo apt-get install build-essential
-
If you see: "WARNING: channel 'pecl.php.net' has updated its protocols":
Run
pecl channel-update pecl.php.net
-
If you see: "Missing sql.h", you will need to install
unixodbc-dev
package.Run
apt-get install -y unixodbc-dev
I'm guessing you're missing the last package, which is necessary for pecl
command to install the PHP drivers.
If it still does not work, please update the complete error message.
You can refer to:
- Linux and macOS Installation Tutorial for the Microsoft Drivers for PHP for SQL Server
- Channel "pecl.php.net" has updated its protocols
- AskUbuntu: Install PECL Packages on Ubuntu