我在 docker 上运行 Ubuntu 20.04。现在我需要使用 PHP 连接到远程 MSSQL 服务器。按照 Microsoft 和各个网站的说明安装 PHP 驱动程序后,我仍然收到以下错误:
PDOException: SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver for SQL Server for x64: https://go.microsoft.com/fwlink/?LinkId=163712 in /root/getDbStatus.php:15
我安装了sqlsrv
和 pdo_sqlsrv
使用 pecl
命令,将扩展 ini 添加到 /etc/php/7.4/mods-available/
手动,并创建到 /etc/php/7.4/cli/conf.d/
的软链接(soft link).以下是一些包信息。
从 phpinfo() 打印。
我还注意到我的 odbc 驱动程序文件实际上是空的,我不知道为什么会这样。
我在这里错过了什么吗?
最佳答案
关于Ubuntu 20.04 中 MSSQL 的 PHP 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69069704/