centos 6.3 x64 php 5.2.6 扩展安装openssl 出错 的解决方法
2014-01-15 18:45
2011 查看
转自:http://www.wenlingnet.com/index.php/258/
以前编译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
后来又找到一个方法,但有待于验证
cd /usr/src/php-4.4.9/ext/openssl
cp -p config0.m4 config.m4
phpize
mv openssl.c openssl.c.bkp
wget http://cpanelstuffs.linuxcabin.com/downloads/openssl.c
Now run the config.
以前编译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
后来又找到一个方法,但有待于验证
cd /usr/src/php-4.4.9/ext/openssl
cp -p config0.m4 config.m4
phpize
mv openssl.c openssl.c.bkp
wget http://cpanelstuffs.linuxcabin.com/downloads/openssl.c
Now run the config.
相关文章推荐
- linux at 计划任务
- ×××公司linux内核驱动开发招聘笔试题
- Linux中设置服务自启动的三种方式
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- linux查找相关文件
- Linux系统禁止普通用户su到root用户的方法
- linux记录pid
- linux下两台服务器文件实时同步方案设计和实现
- 4种启动Linux内核方法----mini2440
- Linux 批量字符串替换命令(sed, perl )与vi文本下字符替换命令
- linux本地化及国际化编程方法(配合资源文档“linux 本地化及国际化编程.pdf”学习效果更好)
- 控制linux动态链接库(so, standard object)导出函数