• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

php5.6安装opensslextension出现编译错误

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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

 

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。

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

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP中使用cURL实现Get和Post请求的方法发布时间:2022-07-10
下一篇:
PclZip:强大的PHP压缩与解压缩zip类发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap