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。

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

  • 相关阅读:
    python学习笔记 | 国内常用源镜像地址
    python学习笔记 | macOS Big Sur动态壁纸食用指南
    GitHub README.md文本编写指南
    FAT32、NTFS、exFAT有什么区别?
    python模块详解 | unittest(单元测试框架)(持续更新中)
    Linux学习笔记 | 常见错误之账户密码正确但是登录不进去系统
    数学建模学习笔记 | matlab基本命令及用法
    selenium自动化 | 借助百度AI开放平台识别验证码登录职教云
    JAVA集合框架
    JAVA集合框架
  • 原文地址:https://www.cnblogs.com/shizouwei/p/6726731.html
Copyright © 2011-2022 走看看