I wrote a class to make it easier to use multi cURL queries. I want to log errors when I get a 404 error or any other error. I already have CURLOPT_FAILONERROR true.
I am currently using curl_multi_info_read() .
and this is my code:
$active = null; do { $multi_exec = curl_multi_exec($this->_multi_handle, $active); } while ($multi_exec == CURLM_CALL_MULTI_PERFORM); while ($active && $multi_exec == CURLM_OK) { if (curl_multi_select($this->_multi_handle) != -1) { do { $multi_exec = curl_multi_exec($this->_multi_handle, $active); $info = curl_multi_info_read($this->_multi_handle); if ( $info['result'] != 0 ) { $this->_errors[] = $info;
The error result is an array like this:
Array ( [0] => Array ( [msg] => 1 [result] => 22
So how can I get the url where the error occurred? this gives me the descriptor resource id
and thanks in advance.
source share