gpt4 book ai didi

php - 在 Ubuntu 10.04 上使用最新的 OpenSSL Opdate Curl

转载 作者:太空宇宙 更新时间:2023-11-03 14:40:55 27 4
gpt4 key购买 nike

我有一台运行 10.04 的非常旧的 Ubuntu 服务器。

它将在整个夏天停止生产,但我现在遇到一个问题,需要我更新 PHP curl 以使用 OpenSSL,所以我有 TLS v 1.2。 10.04 自带的不支持这个版本。

我从 OpenSSL 下载了 v 1.0.1u。

我做了一个:

./buildconf
./configure
make
make install

完成了我做的过程

d7:~/openssl-1.0.1u$ openssl version
OpenSSL 1.0.1u 22 Sep 2016
d7:~/openssl-1.0.1u$ ^C

看来 OpenSSL 的更新似乎已经成功完成了。

所有 OpenSSL 库、 header 等似乎都是在

中创建的
/usr/local/ssl

子目录./lib包含

libcrypto.a 和 libssl.a 我想是静态库。

我认为 openSSL 安装是正确的,看起来没问题。

我下载了 Curl v 7.39.0 并希望它使用新安装的 openSSL 安装。但无论我做什么,似乎都找不到正确的库。

我做了一个:

./buildconf

成功结束

现在问题开始了。

如果我做一个

./配置制作进行安装

它构建了 curl,但没有任何 SSL 支持。

我会执行以下任一操作:

./configure --with-ssl=/usr/local 
./configure --with-ssl --with-libssl-prefix=/usr/local
./configure --with-ssl --with-libssl-prefix=/usr/local/ssl
./configure --with-ssl --with-libssl-prefix=/usr/local/ssl

env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl

它停止 .configure 步骤:

checking for SSL_connect in -lssl... no
checking for ssl with RSAglue/rsaref libs in use... checking for SSL_connect in -lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where specified!

我已经阅读了几个关于如何以这种方式编译 CURLK 的 SO 答案,但它似乎对我不起作用。

任何人都可以阐明我所缺少的东西吗?

最佳答案

我的情况非常相似。在处理了大约一天的参数之后,我发现了使 curl (7.58) 在 openssl 支持下正确编译的神奇之处。

CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib" ./configure  --with-ssl=/usr/local/ssl --enable-shared

我还传入了 --with-zlib 和 --prefix=/usr/local/curl,但这些可能不是绝对必要的。

基本上,您不仅需要告诉它您的 openssl 安装位置,还需要告诉它该目录中一半的特定路径!

关于php - 在 Ubuntu 10.04 上使用最新的 OpenSSL Opdate Curl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43208776/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com