A newly connected server from Apache2 to nginx / 1.4.6 with PHP5-FPM and every time I try to start curl I get:
curl_error(): 287 is not a valid cURL handle resource
Curl is installed (the "curl url" works in the CLI; it works fine), the PHP module is also installed.
My code is:
$file_name_with_full_path = $composed_filename;
$post = array('image'=>'@'.$file_name_with_full_path);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "url");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_PORT , 443);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
$result = curl_exec ($ch);
curl_close ($ch);
I searched and found some answers, but none of them worked. Found one that said cURL may have deleted the handle before it was completed, how can I check this?
source
share