CURL_MULTI_STRERROR(3) 1 CURL_MULTI_STRERROR(3)curl_multi_strerror - Return string describing error codeSYNOPSIS
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 handleSYNOPSIS
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)
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)
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)
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)
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)
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)
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)
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)