猿问

在 TurnKey GNU/Linux 9.11 中安装 sqlsrv php 扩展时出现问题

我尝试使用以下命令在我的 LAMP 服务器中为 php 安装 sqlsrv 和 pdo_sqlsrv 扩展:


pecl install sqlsrv

pecl install pdo_sqlsrv

但因此错误而失败:


Makefile:204: recipe for target 'shared/core_stream.lo' failed

make: *** [shared/core_stream.lo] Error 1

ERROR: `make' failed

更多细节:


lsb_release -a

No LSB modules are available.

Distributor ID: TurnKey

Description:    TurnKey GNU/Linux 9.11 (stretch)

Release:        9.11

Codename:       stretch


odbcinst -j

unixODBC 2.3.7

DRIVERS............: /etc/odbcinst.ini

SYSTEM DATA SOURCES: /etc/odbc.ini

FILE DATA SOURCES..: /etc/ODBCDataSources

USER DATA SOURCES..: /root/.odbc.ini

SQLULEN Size.......: 8

SQLLEN Size........: 8

SQLSETPOSIROW Size.: 8


odbcinst -q -d -n "ODBC Driver 13 for SQL Server"

[ODBC Driver 13 for SQL Server]

Description=Microsoft ODBC Driver 13 for SQL Server

Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2

UsageCount=1

在此先感谢您的帮助


慕侠2389804
浏览 211回答 1
1回答

暮色呼如

您尝试安装的适用于 SQL Server 的 ODBC 驱动程序 13 已经过时,不适合基于您的 Linux 发行版的 Debian 9。您应该安装 ODBC 驱动程序 17:sudo su curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.listexitsudo apt-get updatesudo ACCEPT_EULA=Y apt-get install msodbcsql17# optional: for bcp and sqlcmdsudo ACCEPT_EULA=Y apt-get install mssql-toolsecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profileecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrcsource ~/.bashrc# optional: for unixODBC development headerssudo apt-get install unixodbc-dev# optional: kerberos library for debian-slim distributionssudo apt-get install libgssapi-krb5-2以上代码专用于 Debian 9,可能无法在您的系统上运行,但很可能会。代码来自: Install the Microsoft ODBC Driver for SQL Server on Linux and macOS
随时随地看视频慕课网APP
我要回答