libcurl升级后找不到libcurl.so.3解决之法
本文章今天来给大家介绍一个libcurl升级后找不到libcurl.so.3解决之法,希望对各位朋友有帮助呀。
系统装的是libcurl 7.19的版本,编译的动态库是libcurl.so.4
自己的程序编译是在libcurl 7.15的版本下编译的,用的是libcurl.so.3的版本,要做下软链接即可:
根据自己使用的是32位系统或者64位系统 做如下处理:
代码如下 | 复制代码 |
cd /usr/lib 或者 cd /usr/lib64 |
libcurl主要功能就是用不同的协议连接和沟通不同的服务器~也就是相当封装了的sockPHP 支持libcurl(允许你用不同的协议连接和沟通不同的服务器)。, libcurl当前支持http, https, ftp, gopher, telnet, dict, file, 和ldap 协议。libcurl同样支持HTTPS证书授权,HTTP POST, HTTP PUT, FTP 上传(当然你也可以使用PHP的ftp扩展), HTTP基本表单上传,代理,cookies,和用户认证。
给出我的一个简单的代码例子:
说明:
1.关键在curl_easy_setopt函数设置option,可以设置ftp,http,get,post等许多选项,请根据具体使用情况设置。
2.对取回来的数据需要进行判断,比如http下载文件,如果文件不存在,需要进行处理。因为writer是可以将buf填充404 not found等网页内容的,不能将这个内容当成文件内容,所以需要判断http web返回来的code,进行判断。
3.我有个问题,就是想得到服务器上filename的具体名称,verbose调试已经返回了,但是我在getinfo的时候,试过好多选项,但未找到这个存放真实服务器文件名的选项,如果有知道的麻烦告诉我,谢谢了!
代码如下 | 复制代码 |
long writer(void *data, int size, int nmemb, string &content); void main() } bool CurlInit(CURL *&curl, const char* url,string &content) long writer(void *data, int size, int nmemb, string &content) bool GetURLDataBycurl(const char* URL, string &content) code = curl_global_init(CURL_GLOBAL_DEFAULT); //struct curl_slist *list; return true; |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
