Issue
We are running php on a machine with Centos7, running multiple php versions and we need to install the sql server drivers and are running with the following errors.
we have tried running pecl from the 7.3 php location but it reverts midway to the default pecl instance for the machine, which is 5.6 and fails to complete the task.
running: make
/bin/sh /var/tmp/pear-build-rootL2VMF0/sqlsrv-5.6.1/libtool --mode=compile g++ -std=c++11 -I. -I/var/tmp/sqlsrv -DPHP_ATOM_INC -I/var/tmp/pear-build-rootL2VMF0/sqlsrv-5.6.1/include -I/var/tmp/pear-build-rootL2VMF0/sqlsrv-5.6.1/main -I/var/tmp/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /var/tmp/sqlsrv/conn.cpp -o conn.lo
libtool: compile: g++ -std=c++11 -I. -I/var/tmp/sqlsrv -DPHP_ATOM_INC -I/var/tmp/pear-build-rootL2VMF0/sqlsrv-5.6.1/include -I/var/tmp/pear-build-rootL2VMF0/sqlsrv-5.6.1/main -I/var/tmp/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /var/tmp/sqlsrv/conn.cpp -fPIC -DPIC -o .libs/conn.o
In file included from /var/tmp/sqlsrv/php_sqlsrv_int.h:25:0,
from /var/tmp/sqlsrv/conn.cpp:24:
/var/tmp/sqlsrv/shared/core_sqlsrv.h:2390:38: error: macro "ZVAL_STRINGL" requires 4 arguments, but only 3 given
ZVAL_STRINGL(value_z, str, str_len);
^
/var/tmp/sqlsrv/shared/core_sqlsrv.h:2437:54: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
int zr = ::add_assoc_string(array_z, key, val);
how do we tell pecl to do the whole procedure in php 7.3 so it can run propperly??
Solution
We noticed a week ago that we were missing some pdo php drivers, we installed them via yum and then we succesfully connected the machine to sqlserver
Answered By - Sebastian Ho Chi Min Answer Checked By - Clifford M. (WPSolving Volunteer)