Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

curl_multi_strerror(3) [php man page]

CURL_MULTI_STRERROR(3)							 1						    CURL_MULTI_STRERROR(3)

curl_multi_strerror - Return string describing error code

SYNOPSIS
string curl_multi_strerror (int $errornum) DESCRIPTION
Returns a text error message describing the given CURLM error code. PARAMETERS
o $errornum - One of the CURLM error codes constants. RETURN VALUES
Returns error string for valid error code, NULL otherwise. EXAMPLES
Example #1 curl_multi_strerror(3) example <?php // Create cURL handles $ch1 = curl_init("http://example.com"/); $ch2 = curl_init("http://php.net/"); // Create a cURL multi handle $mh = curl_multi_init(); // Add the handles to the multi handle curl_multi_add_handle($mh, $ch1); curl_multi_add_handle($mh, $ch2); // Execute the multi handle do { $status = curl_multi_exec($mh, $active); // Check for errors if($status > 0) { // Display error message echo "ERROR! " . curl_multi_strerror($status); } } while ($status === CURLM_CALL_MULTI_PERFORM || $active); ?> SEE ALSO
curl_strerror(3), cURL error codes. PHP Documentation Group CURL_MULTI_STRERROR(3)

Check Out this Related Man Page

CURL_MULTI_INIT(3)							 1							CURL_MULTI_INIT(3)

curl_multi_init - Returns a new cURL multi handle

SYNOPSIS
resource curl_multi_init (void ) DESCRIPTION
Allows the processing of multiple cURL handles asynchronously. PARAMETERS
This function has no parameters. RETURN VALUES
Returns a cURL multi handle resource on success, FALSE on failure. EXAMPLES
Example #1 curl_multi_init(3) example This example will create two cURL handles, add them to a multi handle, and process them asynchronously. <?php // create both cURL resources $ch1 = curl_init(); $ch2 = curl_init(); // set URL and other appropriate options curl_setopt($ch1, CURLOPT_URL, "http://lxr.php.net/"); curl_setopt($ch1, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); curl_setopt($ch2, CURLOPT_HEADER, 0); //create the multiple cURL handle $mh = curl_multi_init(); //add the two handles curl_multi_add_handle($mh,$ch1); curl_multi_add_handle($mh,$ch2); $active = null; //execute the handles do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } //close the handles curl_multi_remove_handle($mh, $ch1); curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); ?> SEE ALSO
curl_init(3), curl_multi_close(3). PHP Documentation Group CURL_MULTI_INIT(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

cURL and cgi

I have a CGI application done in c++ that communicates with PayPal. I've had an issue where the application dies when I try to perform a cURL operation. Upon further inspection it seems that I can run cURL examples from the command line. Upon even further inspection it seems that I can run... (8 Replies)
Discussion started by: tatebn
8 Replies

2. UNIX for Dummies Questions & Answers

Using cURL to save online search results

Hi, I'm attacking this from ignorance because I am not sure how to even ask the question. Here is the mission: I have a list of about 4,000 telephone numbers for past customers. I need to determine how many of these customers are still in business. Obviously, I could call all the numbers.... (0 Replies)
Discussion started by: jccbin
0 Replies

3. Shell Programming and Scripting

Logging Via Terminal using cURL

I am having trouble logging in to an account via cURL in the terminal. I need to be able to log in to this page then get a query result from another. I need to do this as a shell script all at once. Im not sure how to handle cookies with terminal & have found very little example. curl ... (1 Reply)
Discussion started by: handell
1 Replies

4. Shell Programming and Scripting

FTP using cURL

Hi I am trying to fetch a file from a remote location and download it into a local directory ...i was previously doing it quite simply using ftp but now i need to do the same using the cURL tool ...Here i am not getting an option to specify a directory name i am trying the following but... (0 Replies)
Discussion started by: jamshedj
0 Replies

5. Shell Programming and Scripting

cURL and variables

I have a spent a day with Google trying to figure this one out and have decided its time to ask the experts... I'm running OS X 10.6 I need to use cURL to FTP a file. I have been successful send the file from the command line when I know the filename. My problem is that the filename changes... (2 Replies)
Discussion started by: fmSimplicity
2 Replies

6. Shell Programming and Scripting

Register account using cURL

Hello! I am trying to register account in Dropbox using cURL. There are a lot of existing examples doing POST and other useful stuff, however it doesn't work for me. Using formpost.pl script i got info: --- FORM report. Uses POST to URL "/register" Input: NAME="t"... (0 Replies)
Discussion started by: diabolusss
0 Replies

7. UNIX for Dummies Questions & Answers

How to include cURL library?

Hi, I've got a project to write a C++ code to open a webpage,read the content and write it in a file. I'm using cURL and compiling the code using G++ in unix. I'm getting compilation error as: "cURL.h: no file or directory". Can some one please tell me how to install/link this library in... (3 Replies)
Discussion started by: Ribosome
3 Replies