This article today will introduce to you a solution to the problem that libcurl.so.3 cannot be found after libcurl upgrade. I hope it will be helpful to all my friends.
The system is installed with version libcurl 7.19, and the compiled dynamic library is libcurl.so.4
My program is compiled under the libcurl 7.15 version, and the libcurl.so.3 version is used. Just make a soft link:
Depending on whether you are using a 32-bit system or a 64-bit system, do the following:
The code is as follows | Copy code | ||||
|
The main function of libcurl is to use different protocols to connect and communicate with different servers ~ that is, sockPHP is quite encapsulated and supports libcurl (allowing you to use different protocols to connect and communicate with different servers). , libcurl currently supports http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificate authorization, HTTP POST, HTTP PUT, FTP upload (of course you can also use PHP's ftp extension), HTTP basic form upload, proxies, cookies, and user authentication.
Give me a simple code example:
Description:
1. The key is to set the option in the curl_easy_setopt function. You can set many options such as ftp, http, get, post, etc. Please set according to the specific usage.
2. The retrieved data needs to be judged, such as http download files. If the file does not exist, it needs to be processed. Because the writer can fill buf with 404 not found and other web page content, and cannot regard this content as file content, so it needs to judge the code returned by http web to make a judgment.
3. I have a problem, that is, I want to get the specific name of the filename on the server. The verbose debugging has returned, but when I tried getinfo, I tried many options, but I did not find this option to store the real server file name. If If you know anything, please tell me, thank you!
The code is as follows | Copy code |
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; |