为了能快速了解并处理您的问题,请提供以下基础信息:
宝塔面板9.2.0
服务器centos stream9。nginx是1.22.1。我php8.3
使用的thinkphp8,要连接的数据库是sqlserver2008r2。我使用宝塔官方扩展,安装pdo-sqlsrv. 提示pdo连接不上。phpinfo显示sqlsrv版本5.11.1。但是微软官网显示5.11可能不支持8.3。不知是不是这个问题引起的。后来,我把php版本切换成8.2和8.1,服务器也重启了,问题和报错还是一样的。现在不知问题在哪
报错如下: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。php中的测试语句为:
try {
Db::connect('aa')->query('SELECT 1');
echo 'sucess';
} catch (\Exception $e) {
var_dump("error");
echo $e->getMessage();
}
|
|