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。

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

 

转载于:https://www.cnblogs.com/shizouwei/p/6726731.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值