Linux系統安裝openssl擴充套件
阿新 • • 發佈:2019-01-30
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
這樣就安裝成功了