zoukankan      html  css  js  c++  java
  • php 5.6 安装openssl extension 出现编译错误

    废话不多说,直接上问题:

    PHP和openssl extension都是最新版本的,标准步骤安装时候出现如下问题:

    php:php-5.6.27

    openssl:openssl-1.1.0e

    ================================

    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3536:31: error: dereferencing pointer to incomplete type
    int len = BN_num_bytes(pkey->pkey._type->_name);
    ^
    /usr/local/openssl/include/openssl/bn.h:142:40: note: in definition of macro ‘BN_num_bytes’
    # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
    ^
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3982:5: note: in expansion of macro ‘OPENSSL_PKEY_GET_BN’
    OPENSSL_PKEY_GET_BN(dh, g);
    ^
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3538:18: error: dereferencing pointer to incomplete type
    BN_bn2bin(pkey->pkey._type->_name, (unsigned char*)str);
    ^
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3982:5: note: in expansion of macro ‘OPENSSL_PKEY_GET_BN’
    OPENSSL_PKEY_GET_BN(dh, g);
    ^
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3535:11: error: dereferencing pointer to incomplete type
    if (pkey->pkey._type->_name != NULL) {
    ^
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3983:5: note: in expansion of macro ‘OPENSSL_PKEY_GET_BN’
    OPENSSL_PKEY_GET_BN(dh, priv_key);
    ^
    In file included from /usr/local/openssl/include/openssl/asn1.h:24:0,
    from /usr/local/openssl/include/openssl/objects.h:916,
    from /usr/local/openssl/include/openssl/evp.h:27,
    from /root/software/php/php-5.6.27/ext/openssl/openssl.c:44:
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3536:31: error: dereferencing pointer to incomplete type
    int len = BN_num_bytes(pkey->pkey._type->_name);
    ^
    /usr/local/openssl/include/openssl/bn.h:142:40: note: in definition of macro ‘BN_num_bytes’
    # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
    ^
    /root/software/php/php-5.6.27/ext/openssl/openssl.c:3983:5: note: in expansion of macro ‘OPENSSL_PKEY_GET_BN’
    OPENSSL_PKEY_GET_BN(dh, priv_key);
    ^
    /root/software/php

    ================================

    在网上搜索了一圈,都没有答案。

    于是打开代码看来一下,看来某些定义的头文件没有引用进来。

    但如本人才疏学浅,对openssl没有整体的把握,所以就对比了之前的openssl版本,发现版本升级后,代码是有变化的。

    具体细节大家可以自己去看。

    解决办法就是:

    把openssl的版本降级,我选择的是openssl-0.9.8v。

    重新编译安装,就不会有编译错误了。

  • 相关阅读:
    ASP.NET实现年月日三级联动(局部刷新)
    通过ip地址获取当前地理位置
    Microsoft.Practices.Unity 给不同的对象注入不同的Logger
    sqlserver 数据库里面金额类型为什么不建议用float,实例告诉你为什么不能。
    bindingredirect 没有效果
    Expression构建DataTable to Entity 映射委托
    windows 2003 远程桌面 连接输入账号密码后,只能看见蓝色屏幕和鼠标
    vmware workstation 10.0.1 install mac os mavericks
    教师节我的专属祝福方式!
    信盈达学员学习心得
  • 原文地址:https://www.cnblogs.com/shizouwei/p/6726731.html
Copyright © 2011-2022 走看看