首先確認(rèn)curl的ssl版本是不是openssl
curl --versioncurl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 nss/3.19.1 basic ecc zlib/1.2.3 libidn/1.18 libssh2/1.4.2
protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
features: gss-negotiate idn ipv6 largefile ntlm ssl libz并沒有?openssl
安裝
cd?/usr/local/src
wget?https://curl.haxx.se/download/curl-7.58.0.tar.gz
tar?-zxvf?curl-7.58.0.tar.gz
cd?curl-7.58.0
./configure?--prefix=/usr/local/curl/?--without-nss?--with-ssl
make?&&?make?install備份默認(rèn)的curl二進(jìn)制文件
mv /usr/bin/curl /usr/bin/curl.bak做一個新的curl軟鏈
ln -s /usr/local/curl/bin/curl /usr/bin/curl再次查看curl版本和支持情況
curl?--versioncurl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 openssl/1.0.1e zlib/1.2.3
release-date: 2018-01-24
protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
features: asynchdns ipv6 largefile ntlm ntlm_wb ssl libz unixsockets https-proxy已有 openssl
進(jìn)入之前安裝php的源碼目錄,重新編譯php
找到之前安裝的編譯參數(shù)
/usr/local/php/bin/php -i | grep configure或者找到文件 /usr/local/php/bin/php-config,其中 configure_options 就為編譯參數(shù)
php源碼目錄下執(zhí)行
./configure --prefix=/usr/local/php --with-curl=/usr/local/curl
--with-freetype-dir --with-gd --with-gettext --with-iconv-dir
--with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli
--with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite
--with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl
--with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath
--enable-libxml --enable-inline-optimization --enable-gd-native-ttf
--enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl
--enable-shmop --enable-soap --enable-sockets --enable-sysvsem
--enable-sysvshm --enable-xml --enable-zip
make
make install
使用phpinfo查看是否支持openssl
舊
新的
轉(zhuǎn)載至:?https://blog.jam00.com/article/info/38.html