php7.3安装curl、openssl扩展

  • Post author:
  • Post category:php


一、安装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



版权声明:本文为qq_40257153原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。