PHP Driver version or file name
pdo_sqlsrv 5.6.1
SQL Server version
Microsoft SQL Server 2017 (RTM-CU14) (KB4484710) - 14.0.3076.1 (X64)
Client operating system
CentOS Linux 7
PHP version
PHP Version 7.3.4 (OpenLiteSpeed 1.4.46)
Microsoft ODBC Driver version
ODBC Driver 17 for SQL Server
Problem description
Compiling a build of the latest release pdo_sqlsrv using OpenLiteSpeed's PHP 7.3 libraries results in errors.
Expected behavior and actual behavior
A successful build is expected. However, in running make test, I see the following:
Repro code or steps to reproduce
https://github.com/Microsoft/msphpsql/issues/983
pdo_sqlsrv 5.6.1
SQL Server version
Microsoft SQL Server 2017 (RTM-CU14) (KB4484710) - 14.0.3076.1 (X64)
Client operating system
CentOS Linux 7
PHP version
PHP Version 7.3.4 (OpenLiteSpeed 1.4.46)
Microsoft ODBC Driver version
ODBC Driver 17 for SQL Server
Problem description
Compiling a build of the latest release pdo_sqlsrv using OpenLiteSpeed's PHP 7.3 libraries results in errors.
Expected behavior and actual behavior
A successful build is expected. However, in running make test, I see the following:
Code:
> make test
/bin/sh /root/pdo_sqlsrv-4.3.0/libtool --mode=compile g++ -I/usr/local/lsws/lsphp73/include/php/ext -std=c++11 -I. -I/root/pdo_sqlsrv-4.3.0 -DPHP_ATOM_INC -I/root/pdo_sqlsrv-4.3.0/include -I/root/pdo_sqlsrv-4.3.0/main -I/root/pdo_sqlsrv-4.3.0 -I/usr/local/lsws/lsphp73/include/php -I/usr/local/lsws/lsphp73/include/php/main -I/usr/local/lsws/lsphp73/include/php/TSRM -I/usr/local/lsws/lsphp73/include/php/Zend -I/usr/local/lsws/lsphp73/include/php/ext -I/usr/local/lsws/lsphp73/include/php/ext/date/lib -I/root/pdo_sqlsrv-4.3.0/shared -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /root/pdo_sqlsrv-4.3.0/pdo_dbh.cpp -o pdo_dbh.lo
libtool: compile: g++ -I/usr/local/lsws/lsphp73/include/php/ext -std=c++11 -I. -I/root/pdo_sqlsrv-4.3.0 -DPHP_ATOM_INC -I/root/pdo_sqlsrv-4.3.0/include -I/root/pdo_sqlsrv-4.3.0/main -I/root/pdo_sqlsrv-4.3.0 -I/usr/local/lsws/lsphp73/include/php -I/usr/local/lsws/lsphp73/include/php/main -I/usr/local/lsws/lsphp73/include/php/TSRM -I/usr/local/lsws/lsphp73/include/php/Zend -I/usr/local/lsws/lsphp73/include/php/ext -I/usr/local/lsws/lsphp73/include/php/ext/date/lib -I/root/pdo_sqlsrv-4.3.0/shared -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /root/pdo_sqlsrv-4.3.0/pdo_dbh.cpp -fPIC -DPIC -o .libs/pdo_dbh.o
In file included from /usr/local/lsws/lsphp73/include/php/Zend/zend.h:27:0,
from /usr/local/lsws/lsphp73/include/php/main/php.h:33,
from /root/pdo_sqlsrv-4.3.0/shared/core_sqlsrv.h:34,
from /root/pdo_sqlsrv-4.3.0/php_pdo_sqlsrv.h:23,
from /root/pdo_sqlsrv-4.3.0/pdo_dbh.cpp:20:
/root/pdo_sqlsrv-4.3.0/shared/core_sqlsrv.h: In function 'void core::sqlsrv_array_init(sqlsrv_context&, zval*)':
/usr/local/lsws/lsphp73/include/php/Zend/zend_types.h:792:24: error: expected id-expression before 'do'
#define ZVAL_ARR(z, a) do { \
^
/usr/local/lsws/lsphp73/include/php/Zend/zend_API.h:377:28: note: in expansion of macro 'ZVAL_ARR'
#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
^
/root/pdo_sqlsrv-4.3.0/shared/core_sqlsrv.h:2243:20: note: in expansion of macro 'array_init'
int zr = ::array_init(new_array);
^
/usr/local/lsws/lsphp73/include/php/Zend/zend_types.h:797:4: error: expected ',' or ';' before 'while'
} while (0)
^
/usr/local/lsws/lsphp73/include/php/Zend/zend_API.h:377:28: note: in expansion of macro 'ZVAL_ARR'
#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
^
/root/pdo_sqlsrv-4.3.0/shared/core_sqlsrv.h:2243:20: note: in expansion of macro 'array_init'
int zr = ::array_init(new_array);
^
/root/pdo_sqlsrv-4.3.0/pdo_dbh.cpp: In function 'int pdo_sqlsrv_db_handle_factory(pdo_dbh_t*, zval*)':
/root/pdo_sqlsrv-4.3.0/pdo_dbh.cpp:505:34: error: 'ZVAL_INTERNAL_DTOR' was not declared in this scope
ZVAL_INTERNAL_DTOR, 0 /*persistent*/ TSRMLS_CC );
^
make: *** [pdo_dbh.lo] Error 1
- Ensure latest release of OpenLiteSpeed as well as the required compilation packages (e.g. gcc) are installed.
- Use the follow commands:
A. wget https://pecl.php.net/get/pdo_sqlsrv-5.6.1.tgz
B. tar -zxvf pdo_sqlsrv-5.6.1.tgz
C. cd pdo_sqlsrv-5.6.1
D. /usr/local/lsws/lsphp73/bin/phpize
E. ./configure --with-php-config=/usr/local/lsws/lsphp73/bin/php-config
F. make
E. make test
F. sudo make install
https://github.com/Microsoft/msphpsql/issues/983
Last edited: