1.进入php安装目录
cd /opt/datrix/php
2.下载php 安装包 并解压
wget http://php.net/get/php-5.5.37.tar.bz2/from/a/mirror
tar 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 m4
yum install autoconf
运行成功的信息:
@root:# /opt/datrix/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
4.编译
./configure --with-openssl --with-php-config=/opt/datrix/php/bin/php-config
make
make test
执行make test出现下面问题
解决方法
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
这样就安装成功了