简体   繁体   English

Ubuntu 20.04.2 PHP 安装 pecl 时出错

[英]Ubuntu 20.04.2 PHP Error while pecl install

I'm trying to install sqlsrv driver.我正在尝试安装 sqlsrv 驱动程序。

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. pecl版本信息。

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
  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.如果它说:“没有适用于 package 的版本... ”,您将需要安装 php-dev package 以获取必要的 PHP5 源文件来编译其他模块。

    Run apt-get install php-dev运行apt-get install php-dev

    You can specify specific version: apt-get install php8.0-dev可以指定具体版本: apt-get install php8.0-dev

  2. If you see: " WARNING: channel 'pecl.php.net ' has updated its protocols":如果您看到:“警告:频道 'pecl.php.net ' 已更新其协议”:

    Run pecl channel-update pecl.php.net运行pecl channel-update pecl.php.net

  3. If you see: " Missing sql.h ", you will need to install unixodbc-dev package.如果您看到:“缺少 sql.h ”,则需要安装unixodbc-dev package。

    Run apt-get install -y unixodbc-dev运行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.我猜你错过了最后一个 package,这是pecl命令安装 PHP 驱动程序所必需的。

If it still does not work, please update the complete error message.如果还是不行,请更新完整的错误信息。

You can refer to:你可以参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM