php7.4安装pdo_sqlsrv扩展
下载:wget http://pecl.php.net/get/pdo_sqlsrv-5.10.0.tgz
tar -zxvf pdo_sqlsrv-5.10.0.tgz
cd pdo_sqlsrv-5.10.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
yum install unixODBC-devel 若上一步报错,执行此命令
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
extension=pdo_sqlsrv.so
连接sql server服务器失败
安装ODBC Driver 17 for SQL Server
wget https://packages.microsoft.com/rhel/7/prod/msodbcsql17-17.3.1.1-1.x86_64.rpm
rpm -ivh msodbcsql17-17.3.1.1-1.x86_64.rpm
ll /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
安装后,测试连接成功!
参考资料:
https://blog.csdn.net/lajihzc/article/details/122919290
https://www.nikozhang.cn/blog/post/niko/CentOS7%E5%AE%89%E8%A3%85ODBC-DRIVER%E8%BF%9E%E6%8E%A5SQL-Server
https://blog.csdn.net/weixin_43413062/article/details/108640818
总结:
重点参考:https://www.cnblogs.com/tech-test/p/16891714.html
需要安装unixODBC、freetds、pdo_sqlsrv,安装顺序也要按照这个;
编译freetds,用 ./configure --with-tdsver=8.0
参考资料:
https://blog.51cto.com/u_15252276/5026893
https://www.cnblogs.com/jfqy/p/14365295.html
https://blog.csdn.net/qq_25549309/article/details/51555789
https://www.zhangshilong.cn/work/187804.html
https://blog.csdn.net/weixin_34827430/article/details/116630508