先安裝依賴包:yum install openssl openssl-devel
進(jìn)入PHP安裝包里的OpenSSL文件夾,根據(jù)個(gè)人的安裝包位置不同,此處是
cd /home/local/php.5.6.25/ext/openssl/
phpize
可能會(huì)報(bào)錯(cuò):Cannot find config.m4.
Make sure that you run /usr/local/bin/phpize in the top level source directory of the module,
在當(dāng)前目錄下執(zhí)行:mv config0.m4 config.m4
重新phpize
./configure --with-php-config=/usr/local/php/bin/php-config(php-config文件的路徑)
make
make install
將openssl.so復(fù)制到PHP擴(kuò)展文件夾中
修改php.ini中 extesion=openssl.so
以上這篇linux環(huán)境下安裝PHP的OpenSSL擴(kuò)展的方法講解就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持服務(wù)器之家。
原文鏈接:http://www.cnblogs.com/ttiandeng/p/6560534.html