centos6.5安装php sqlsrv拓展遇到的坑

首先要升级gcc库,之后安装直接sqlsrv拓展时,会提示缺少glibc2.14,此时坑就开始了。(低版本的gcc库会一直存在,需要删除软连接https://blog.csdn.net/lhh1113/article/details/64441802)

如果直接安装glibc2.14库,就等着哭吧,妥妥的安装不上。各种欲哭无泪。。。。。

见https://www.v2ex.com/t/481867,没办法,只能试着安装glinc2.17,(安装详见https://vissssa.gitbook.io/mysoul/env/sheng-ji-glibc-dao-2.17)

wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm

sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
glibc-common-2.17-55.el6.x86_64.rpm \
glibc-devel-2.17-55.el6.x86_64.rpm \
glibc-headers-2.17-55.el6.x86_64.rpm

安装好之后,继续安装编译pdo——sqlsrv拓展,然而还是报错

NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_sqlsrv.so' - /usr/lib64/php/modules/pdo_sqlsrv.so: undefined symbol: php_pdo_register_driver in Unknown on line

pdo_sqlsrv 安装详见https://www.jianshu.com/p/5f6af4f71672(依然有坑,sqlsrv扩展能正常安装,pdo_sqlsrv确有问题,)

pecl安装后报错

unrecognized command line option “-std=c++11”

,发现系统中存在多个版本的gcc导致这一问题,https://blog.csdn.net/lhh1113/article/details/64441802

多次尝试,终于发现(http://code.liboliu.com/?p=361)

带有pdo_*相关的扩展,是依赖pdo.so的,所以必须在引入pdo.so之后才能引入

centos6.5安装php sqlsrv拓展遇到的坑_第1张图片

重启php-fpm之后,发现果然装上pdo_sqlsrv扩展了

centos6.5安装php sqlsrv拓展遇到的坑_第2张图片

 

你可能感兴趣的:(php,sqlsrv配置)