Linux系统安装openssl扩展

来源:互联网 发布:哪个银行的淘宝卡最好 编辑:程序博客网 时间:2024/05/16 19:09

1.进入php安装目录

cd /opt/datrix/php

2.下载php 安装包 并解压

wget http://php.net/get/php-5.5.37.tar.bz2/from/a/mirrortar zxvf php-5.6.23

3.运行phpize

/opt/datrix/php/bin/phpize错误1# 执行后,发现错误 无法找到config.m4 ,config0.m4就是config.m4。直接重命名#mv config0.m4 config.m4错误2#Cannot find build files at '/opt/php/lib/php/build'. Please check your PHP installation.##这个错误的原因是安装php的时候的加的prefix(安装目录)和代码目录不在一起##解决办法:建立一个软连接,将php的安装目录建立软连接 如下#ln -s /opt/datrix/php/ /opt/php

继续报错
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

解决方法yum install m4yum install autoconf

运行成功的信息:

@root:# /opt/datrix/php/bin/phpizeConfiguring for:PHP Api Version:         20131106Zend Module Api No:      20131226Zend Extension Api No:   220131226

4.编译

./configure --with-openssl --with-php-config=/opt/datrix/php/bin/php-configmakemake test

执行make test出现下面问题
error

解决方法

vi //opt/datrix/php/bin/php.ini#找到disable_functions = shell_exec, system, passthru, exec, popen, proc_open#去掉 proc_open保存重新执行make test 就可以了
make install

5.修改php.ini

extension_dir="/opt/datrix/php/lib/php/extensions/no-debug-zts-20131226"extension=openssl.so

这样就安装成功了

0 0
原创粉丝点击