PHP7.X连接SQLSERVER数据库(CENTOS7)
一、加入微软的源
curl https:
//packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssqlrelease.repo
二、防止冲突先卸载原有版本(可选)
yum remove unixODBC
三、安装驱动(三个都要装上,缺一不可)
yum install msodbcsql mssql-tools unixODBC-devel
四、下载pdo_sqlsrv扩展包 http://pecl.php.net/package/pdo_sqlsrv
五、以4.0.8为例
tar -zxvf pdo_sqlsrv-4.0.8.tgz
六、进入解压目录
cd pdo_sqlsrv-4.0.8
七、执行PHP的一个扩展命令
/usr/local/php/bin/phpize
八、编译
./configure --with-php-config=/usr/local/php/bin/php-config
九、安装
make && make install
十、修改/usr/local/php/etc/php.ini 查找:extension = 再最后一个extension= 后面添加上extension = "pdo_sqlsrv.so"
原文地址:https://www.cnblogs.com/ytjjyy/p/8119708.html
相关推荐
Noneyes 2020-11-10
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23
savorTheFlavor 2020-10-23