首页 > LNMP应用服务器 > 通过phpize为php在不重新编译php情况下安装模块openssl

通过phpize为php在不重新编译php情况下安装模块openssl

2015年10月17日

通过phpize为php在不重新编译php情况下安装模块openssl

http://www.cnblogs.com/xiangxiaodong/archive/2013/07/30/3225718.html
假定:
php编译安装路径:/usr/local/php/
apache编译安装路径:/usr/local/apache/
php配置文件路径:/etc/php.ini
php安装源路径:/usr/source/php-5.3.9/
[[email protected] ~]# cd /usr/source/php-5.3.9/ext/openssl/

[[email protected] openssl]# /usr/local/php/bin/phpize
Cannot find config.m4.
Make sure that you run ‘/usr/local/php/bin/phpize’ in the top level source directory of the module

[[email protected] openssl]# cp ./config0.m4 ./config.m4

[[email protected] openssl]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626

[[email protected] openssl]# ./configure –with-openssl –with-php-config=/usr/local/php/bin/php-config
注:如果不想使用php自带的ext里的openssl的话 可使用参数“–with-openssl=DIR” Include OpenSSL support (requires OpenSSL >= 0.9.6)

[[email protected] openssl]# make

[[email protected] openssl]# make install

在php.ini中加载openssl.so
[[email protected] openssl]# vi /etc/php.ini
加入:
extension = “openssl.so”

重启apache:
[[email protected] ~]# /usr/local/apache/bin/apachectl -k restart

检验方法1:
通过phpinfo检验是否加载了openssl模块

<?php

echo phpinfo();

?>

检验方法2:

[[email protected] openssl]# cd ~
[[email protected] ~]# vi test.php
php code:

error_reporting(E_ALL);
$a = file_get_contents(‘https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL’);
var_dump($a);

[[email protected] ~]# /usr/local/php/bin/php ~/test.php
返回wsdl xml文件,表示安装成功

分类: LNMP应用服务器 标签:
本文的评论功能被关闭了.