php拓展-php安装sqlservesqlsrv-宝塔

laravel报错

1
2
Illuminate\Database\QueryException
could not find driver (SQL: select top 1 * from [lswl_event] where [lswl_event].[event_id] = 1)

一、【加入微软的源】

1
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssqlrelease.repo

二、【安装驱动】

1
yum -y install msodbcsql mssql-tools unixODBC-devel

3、编译

1
2
3
4
5
6
7
8
9
wget http://pecl.php.net/get/pdo_sqlsrv-5.8.0.tgz
tar -zxvf pdo_sqlsrv-5.8.0.tgz
cd pdo_sqlsrv-5.8.0

phpize
./configure --with-php-config=/www/server/php/73/bin/php-config
make
make install

4、 修改php.ini

1
extension=/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/pdo_sqlsrv.so
作者

舰长胡椒

发布于

2022-08-18

更新于

2023-10-13

许可协议

评论