开发者社区> 问答> 正文

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

/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;
 

展开
收起
爱吃鱼的程序员 2020-06-05 13:49:36 1186 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <h2>建议用centos 7 </h2>
                    
    
                        <p>猜测是pdo_sqlsrv版本过高不支持低版本php造成的.请确认sqlsrv版本要求</p>
                    
    
                        <div class="ref">
    

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

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

                            3.2最适合php5.6,但是3.2最高只支持SQL Server 2014,这是一个艰难的选择:smile:
                        
    
                        <p>怎么解决的呢?</p>
    
    2020-06-05 13:49:49
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载
PHP运行机制初探 立即下载