Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 20.04.2 PHP Error while pecl install

Tags:

linux

php

ubuntu

I'm trying to install sqlsrv driver.

root@testapp:/# pecl install sqlsrv

Notice: Trying to access array offset on value of type bool in PEAR/REST.php on line 187
PHP Notice:  Trying to access array offset on value of type bool in /usr/share/php/PEAR/REST.php on line 187

pecl version information.

root@testapp:/# pecl version
PEAR Version: 1.10.9
PHP Version: 7.4.3
Zend Engine Version: 3.4.0
Running on: Linux test app 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64
like image 582
Tugce Aksoz Avatar asked Oct 19 '25 02:10

Tugce Aksoz


1 Answers

  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

  2. If you see "make: not found", you need to have make installed

    Run sudo apt-get install build-essential

  3. If you see: "WARNING: channel 'pecl.php.net' has updated its protocols":

    Run pecl channel-update pecl.php.net

  4. 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
like image 99
NcXNaV Avatar answered Oct 21 '25 16:10

NcXNaV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!