centos 6 php5.6 安装pdo_sqlsrv时,编译报错,跪求感谢各路大佬指点

blue_ma 发布于 05/24 10:53
阅读 176
收藏 0

解读下一代网络:算力网络正从理想照进现实!>>>

/bin/sh /root/pdo_sqlsrv-5.3.0/libtool --mode=compile g++ -I/usr/local/php/include/php/ext -std=c++11 -I. -I/root/pdo_sqlsrv-5.3.0 -DPHP_ATOM_INC -I/root/pdo_sqlsrv-5.3.0/include -I/root/pdo_sqlsrv-5.3.0/main -I/root/pdo_sqlsrv-5.3.0 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/root/pdo_sqlsrv-5.3.0/shared  -DHAVE_CONFIG_H  -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector   -c /root/pdo_sqlsrv-5.3.0/pdo_dbh.cpp -o pdo_dbh.lo 
 g++ -I/usr/local/php/include/php/ext -std=c++11 -I. -I/root/pdo_sqlsrv-5.3.0 -DPHP_ATOM_INC -I/root/pdo_sqlsrv-5.3.0/include -I/root/pdo_sqlsrv-5.3.0/main -I/root/pdo_sqlsrv-5.3.0 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/root/pdo_sqlsrv-5.3.0/shared -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /root/pdo_sqlsrv-5.3.0/pdo_dbh.cpp  -fPIC -DPIC -o .libs/pdo_dbh.o
In file included from /root/pdo_sqlsrv-5.3.0/php_pdo_sqlsrv.h:23:0,
                 from /root/pdo_sqlsrv-5.3.0/pdo_dbh.cpp:20:
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:2322:38: error: macro "ZVAL_STRINGL" requires 4 arguments, but only 3 given
    ZVAL_STRINGL(value_z, str, str_len);
                                      ^
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:2369:54: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
         int zr = ::add_assoc_string(array_z, key, val);
                                                      ^
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:2397:58: error: macro "zend_hash_get_current_data" requires 2 arguments, but only 1 given
   int zr = (output_data = ::zend_hash_get_current_data(ht)) != NULL ? SUCCESS : FAILURE;
                                                          ^
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:2421:70: error: macro "zend_hash_index_update" requires 5 arguments, but only 3 given
         int zr = (data_z = ::zend_hash_index_update(ht, index, data_z)) != NULL ? SUCCESS : FAILURE;
                                                                      ^
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:2446:64: error: macro "zend_hash_next_index_insert" requires 4 arguments, but only 2 given
         int zr = (data = ::zend_hash_next_index_insert(ht, data)) != NULL ? SUCCESS : FAILURE;
                                                                ^
/root/pdo_sqlsrv-5.3.0/pdo_dbh.cpp:1395:83: error: macro "zend_hash_get_current_data" requires 2 arguments, but only 1 given
         if (( placeholder = zend_hash_get_current_data( driver_stmt->placeholders )) != NULL && zend_hash_move_forward( driver_stmt->placeholders ) == SUCCESS && stmt->bound_params != NULL ) {
                                                                                   ^
In file included from /root/pdo_sqlsrv-5.3.0/php_pdo_sqlsrv.h:23:0,
                 from /root/pdo_sqlsrv-5.3.0/pdo_dbh.cpp:20:
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:248:5: error: ‘zend_long’ does not name a type
     zend_long value;
     ^
/root/pdo_sqlsrv-5.3.0/shared/core_sqlsrv.h:262:5: error: ‘zend_long’ does not name a type
     zend_long value;
 

加载中
0
旧城新人
旧城新人

猜测是pdo_sqlsrv版本过高不支持低版本php造成的.请确认sqlsrv版本要求

0
旧城新人
旧城新人

引用来自“旧城的骁珖”的评论

猜测是pdo_sqlsrv版本过高不支持低版本php造成的.请确认sqlsrv版本要求

使用php连接sqlserver数据库,兼容性要求看这里 

 https://docs.microsoft.com/en-us/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-ver15

https://docs.microsoft.com/en-us/sql/connect/php/microsoft-php-drivers-for-sql-server-support-matrix?view=sql-server-ver15#php-version-support

比如目前还比较常用的sql2008版本 sqlsrv最好选择4.3版本等等.简单的方法找目前已存在的docker容器环境,避免编译

自由PHP
自由PHP
3.2最适合php5.6,但是3.2最高只支持SQL Server 2014,这是一个艰难的选择:smile:
0
嘴角轻扬30
嘴角轻扬30

怎么解决的呢?

返回顶部
顶部