php.ini,搜索 ;extension=php_openssl.dll,去掉分號;若無此行則手動添加 extension=php_openssl.dll。php_openssl.dllssleay32.dlllibeay32.dll目標路徑:C:\Windows\System32(64 位系統亦放此處)。
iisreset /restart)。cd /var/www/php5
wget https://mirrors.sohu.com/php/php-5.2.14.tar.gz
tar zxvf php-5.2.14.tar.gz
cd php-5.2.14/ext/openssl/
/var/www/php5/bin/phpize
# 若報錯找不到 config.m4
mv config0.m4 config.m4
/var/www/php5/bin/phpize
./configure --with-openssl --with-php-config=/var/www/php5/bin/php-config
make && make install
編譯成功會提示 openssl.so 路徑,將其複製到 php.ini 中 extension_dir 指定的目錄(如 /var/www/php5/lib/php/extensions)。
extension=openssl.so
/usr/local/apache2/bin/apachectl restart
執行 php -m | grep openssl 或瀏覽 phpinfo() 頁面搜索 "OpenSSL support" 顯示 enabled 即成功。
openssl-devel(CentOS)或 libssl-dev(Ubuntu/Debian)。phpize、php-config 路徑需指向目標 PHP 安裝目錄。