CentOS7 PHP cURL errno 35, 原因:CentOS7中没有安装curl和OpenSSL的最新版
安装OpenSSL的最新版
话不多说,直接上安装步骤
#cd /usr/local/src
# 跳过证书获取失败
# wget https://www.openssl.org/source/openssl-1.0.2n.tar.gz --no-check-certificate
# tar xzvf openssl-1.0.2n.tar.gz
# cd openssl-1.0.2n
# ./config shared enable-ssl2 enable-ssl3 --prefix=/usr
# make depend
# make
# #确认没有错误
# make test
# make install
# #如果顺利的话就好了
# openssl version
进展顺利
安装curl的最新版
这里也大体上就那样,不过,因为wget curl的文件的时候,SSL通信用其他的方法取得
# cd /usr/local/src
# #如果wget不能用其他的方法下载
# wget https://curl.haxx.se/download/curl-7.58.0.tar.gz
# tar xzvf curl-7.58..tar.gz
# cd curl-7.58.
# ./configure --enable-libcurl-option --with-ssl=/usr --prefix=/usr
./confirure 的输出结果的一部分如下:
--如果弄错with-ssl的目录指定,SSL support的部分变成no。
--libcurl option:也确认一下是enabled吧。
configure: Configured to build curl/libcurl: curl version: 7.58.
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr
Compiler: gcc
SSL support: enabled (OpenSSL)
SSH support: no (--with-libssh2)
zlib support: enabled
brotli support: no (--with-brotli)
GSS-API support: no (--with-gssapi)
TLS-SRP support: enabled
resolver: POSIX threaded
IPv6 support: enabled
Unix sockets support: enabled
IDN support: no (--with-{libidn2,winidn})
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
ca cert path: no
ca fallback: no
LDAP support: enabled (OpenLDAP)
LDAPS support: enabled
RTSP support: enabled
RTMP support: no (--with-librtmp)
metalink support: no (--with-libmetalink)
PSL support: no (libpsl not found)
HTTP2 support: disabled (--with-nghttp2)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
然后 make
# make
中途输出Warning: compression requested but Gzip is not available,这次没有通过!好像在hugehelp.c上输出了什么,应该不是严重的错误……?
然后 make install
# make install
下面显示输出结果的一部分。
/bin/sh ../libtool --mode=install /usr/bin/install -c libcurl.la '/usr/lib'
libtool: install: /usr/bin/install -c .libs/libcurl.so.4.5. /usr/lib/libcurl.so.4.5. (略) ----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for
more information, such as the ld() and ld.so() manual pages.
----------------------------------------------------------------------
安装好了, curl -V 不过有错误。
curl: error while loading shared libraries: libcurl.so.: cannot open shared object file: No such file or directory
好像无法读取库。
如果用ldd /usr/bin/curl确认的话,确实没有libcurl.so.4 =>的参照处。但是make install的时候/usr/lib/libcurl.so.4.5.0上写着安装了。
用共享库就好。(http://www.8wave.net/ldconfig.html)
# # 在末尾添加“/usr/lib”
# vim /etc/ld.so.conf.d/lib.conf
# ldconfig
这样就OK了。
curl -V
输出结果
curl 7.58. (x86_64-pc-linux-gnu) libcurl/7.58. OpenSSL/1.0.2n zlib/1.2.
Release-Date: --
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy
大功告成!
CentOS7 PHP cURL errno 35, 原因:CentOS7中没有安装curl和OpenSSL的最新版的更多相关文章
- ubuntu16.04中docker安装curl拒绝连接问题
在Ubuntu16.04中安装docker ce,安装步骤按照官网说明https://docs.docker.com/engine/installation/linux/docker-ce/ubunt ...
- CentOS7开启docker远程访问并在idea中连接使用
CentOS7开启docker远程访问并在idea中连接使用 1.编辑/usr/lib/systemd/system/docker.service,配置远程访问.主要是在[Service]这个部分,添 ...
- centos7.x 将普通用户加入sudoers中,获取sudo执行权限
centos7.x 将普通用户加入sudoers中,获取sudo执行权限 0 问题由来 你在提起兴致学习的时候,兴冲冲地往黑洞洞的文本窗口输入下一行: [pan@localhost ~]$ sud ...
- RabbitMQ3.9.7在CentOS7中的安装搭建
1.概述 RabbitMQ 是目前很流行的消息中间件之一,可靠性非常好,能简单的实现高可用.负载均衡. 今天我们先来聊一下 RabbitMQ 3.9.7 版本在 CentOS7 中的安装. 2.安装R ...
- CURL库在C++程序中的运用浅析
最近由于要做一个爬虫项目,要对很多网站进行爬取,所以一直都在看这方面的文章.在翻阅了很多资料后,下载了一个curl库,着实对项目有了很大的帮助. 一.LibCurl基本编程框架 二.一些基本的函数 三 ...
- [转帖]【rinetd】CentOS7.x上轻量级TCP转发工具rinetd的安装配置
[rinetd]CentOS7.x上轻量级TCP转发工具rinetd的安装配置 https://www.jianshu.com/p/2605d247b944 这一个写的更加全面了. 2019.07.0 ...
- PHP中fopen,file_get_contents,curl函数的区别
PHP中fopen,file_get_contents,curl函数的区别 1.fopen/file_get_contents每次请求都做DNS查询,并不对DNS的信息进行缓存,而curl会对DNS的 ...
- [转]PHP中fopen,file_get_contents,curl的区别
1. fopen /file_get_contents 每次请求都会重新做DNS查询,并不对 DNS信息进行缓存.但是CURL会自动对DNS信息进行缓存.对同一域名下的网页或者图片的请求只 ...
- SQL点滴35—SQL语句中的exists
原文:SQL点滴35-SQL语句中的exists 比如在Northwind数据库中有一个查询为 SELECT c.CustomerId,CompanyName FROM Customers c WHE ...
随机推荐
- 微服务springboot视频最新SpringBoot2.0.3版本技术视频教程【免费学习】
超火爆的springboot微服务技术怎么学,看这里,springboot超详细的教程↓↓↓↓↓↓https://ke.qq.com/course/179440?tuin=9b386640 01.sp ...
- msf端口扫描
使用MSF发现主机和端口扫描 使用search命令查找需要的模块 MSF模块太多,记不住怎么办!!! 我们不需要记住所有模块,我们只要能找到我们想用的模块就行,平时积累使用的模块也行哦! 比如,我们通 ...
- SQL连接查询基础知识点
什么是连接 连接(join)查询是基于多个表中的关联字段将数据行拼接到一起,可以同时返回多个表中的数据. 下面以两个表为例子,举例说明一下不同的连接. SELECT * FROM products i ...
- JAVA基础知识|lambda与stream
lambda与stream是java8中比较重要两个新特性,lambda表达式采用一种简洁的语法定义代码块,允许我们将行为传递到函数中.之前我们想将行为传递到函数中,仅有的选择是使用匿名内部类,现在我 ...
- eclipse CDT Error: Program "g++" not found in PATH
右击project explore ->properties- >c/c++ build->environment , 设置 mingw_home 路径
- Mac卸载mysql数据库
mac下的应用程序中一般是无法找到mysql的安装文件进行直接删除的,所以,通常需要打开命令行工具Terminal后,使用如下的命令进行删除: 1 sudo rm /usr/local/mysql2 ...
- LC 985. Sum of Even Numbers After Queries
We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i] ...
- SD卡状态监听(无序广播)
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Int ...
- SpringBoot: 11.异常处理方式1(自定义异常页面)(转)
SpringBoot 默认的处理异常的机制:SpringBoot 默认的已经提供了一套处理异常的机制.一旦程序中出现了异常 SpringBoot 会向/error 的 url 发送请求.在 sprin ...
- iOS-ShareSDK的使用(转)
官方下载ShareSDK iOS:http://sharesdk.cn/ ShareSDK社会化分享 包含“社会化分享组件”“社会化登录组件”“第三方评论和赞”三大模块,并有详尽的数据统计后台,助力移 ...