前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法

CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法

作者头像
星哥玩云
发布2022-06-30 21:34:49
8400
发布2022-06-30 21:34:49
举报
文章被收录于专栏:开源部署开源部署

以前编译php没有 –with–openssl 现在要使用到 openssl ,phpinze扩展安装,但是在make时候报错

今天找这个在网上找了大半天,最后总结应该是php版本本身的问题,错误是php编译好后,通过phpize单独添加时候报错的内容

问题: /usr/local/src/php-5.2.6/ext/openssl/openssl.c:229: error: expected specifier-qualifier-list before ‘LHASH’ /usr/local/src/php-5.2.6/ext/openssl/openssl.c:410: error: expected declaration specifiers or ‘…’ before ‘LHASH’ /usr/local/src/php-5.2.6/ext/openssl/openssl.c: In function ‘php_openssl_config_check_syntax’: ? ? /usr/local/src/php-5.2.6/ext/openssl/openssl.c:416: error: ‘config’ undeclared (first use in this function) ? ? /usr/local/src/php-5.2.6/ext/openssl/openssl.c:416: error: (Each undeclared identifier is reported only once ? ? /usr/local/src/php-5.2.6/ext/openssl/openssl.c:416: error: for each function it appears in.) ? ? /usr/local/src/php-5.2.6/ext/openssl/openssl.c: In function ‘add_oid_section’: ? ? /usr/local/src/php-5.2.6/ext/openssl/openssl.c:435: error: ’struct php_x509_request’ has no member named ‘req_config’ /usr/local/src/php-5.2.6/ext/openssl/openssl.c:439: error: ’struct php_x509_request’ has no member named ‘req_config’?

解决思路

php5.2.5 ?php5.2.6 ?php5.2.8 php5.3.0

php安装好后在独立安装openssl扩展会有问题,推荐使用php5.2.17 ?wget http://museum.php.net/php5/php-5.2.17.tar.gz

这个是经过测试的出来的结果

安装过程: #下面是php的安装目录 /usr/local/php5/bin/?

? #切换到php安装目录的 etx/openssl目录 cd /php-5.2.17/ext/openssl?

? #查看openssl目录下有个config0.m4,把config0.m4改名为config.m4。 cp config0.m4 config.m4?

? #依次执行: ? ? /usr/local/php5/bin/phpize?

? ./configure –with-openssl –with-php-config=/usr/local/php5/bin/php-config?

? make && make install?

? #然后找到php.ini所在位置 打开 extension_dir(如果没有则自行添加), 同时添加 extension = “openssl.so”?

#重启服务器 即可?

#openssl 查看方法: ? ? /usr/local/php5/bin/php -m |grep openssl

本文参与?腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客?前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与?腾讯云自媒体分享计划? ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
SSL 证书
腾讯云 SSL 证书(SSL Certificates)为您提供 SSL 证书的申请、管理、部署等服务,为您提供一站式 HTTPS 解决方案。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com