一、安装openssl
cd /root
wget https://www.openssl.org/source/openssl-3.0.8.tar.gz
tar xvzf openssl-3.0.8.tar.gz
cd openssl-3.0.8
./config
make
make install
解决 OpenSSL 1.1.i and "Can't locate FindBin.pm in @INC"
dnf install perl
openssl version -a 查看openssl版本
二、安装curl
cd /root
wget https://curl.se/download/curl-8.0.1.tar.gz
tar -xvf curl-8.0.1.tar.gz
cd curl-8.0.1
./configure --with-openssl
make
make install
查看版本
curl --version
显示curl 8.0.1表示安装成功
完成一二两步就可以在命令行输入,查看是否正常运行
curl https://www.baidu.com
三、PHP安装openssl扩展
cd /root/php-7.3.0/ext/openssl
cp config0.m4 config.m4
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-openssl
make V=s -j$(nproc) && make install
报错:‘RSA_SSLV23_PADDING’ undeclared (first use in this function); did you mean ‘RSA_NO_PADDING’?
cd /root
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
tar xvzf openssl-1.1.1q.tar.gz
cd openssl-1.1.1q
./config
make
make install解决 OpenSSL 1.1.i and "Can't locate FindBin.pm in @INC"
dnf install perl
生成了一个扩展文件 openssl.so
vi /usr/local/php/lib/php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/openssl.so
四、PHP安装curl扩展
cd /root/php-7.3.0/ext/curl
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-curl=/root/curl
报错:checking for cURL 7.15.5 or greater... configure: error: cURL version 7.15.5 or later is required to compile php with cURL support
解决报错:
https://curl.se/download/archeology/ 挑选一个curl的版本
https://curl.se/download/archeology/curl-7.20.0.tar.gz 这边挑选了这个版本cd /root
wget https://curl.se/download/archeology/curl-7.20.0.tar.gz
tar zxvf curl-7.20.0.tar.gz
cd curl-7.20.0
./configure --with-ssl=/usr/local/ssl
make && make install
make && make install
生成了一个扩展文件 curl.so
vi /usr/local/php/lib/php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/curl.so文章来源:https://www.toymoban.com/news/detail-773389.html
文章来源地址https://www.toymoban.com/news/detail-773389.html
到了这里,关于php7.3安装curl、openssl扩展的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!