pecl sqlsrv pdo_sqlsrv (MSSQL) on CentOS 6

pecl install sqlsrv pdo_sqlsrv( configure or make error because of gcc version)

make error

core_conn.cpp  error: expected type-specifier

#Gcc version must be 4.8.xx install

wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo 
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ 

#add /etc/profile 
export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++

#. /etc/profile or source /etc/profile

pecl install sqlsrv pdo_sqlsrv

 

Leave a Reply