Using CURLINFO_HEADER_OUT= true may cause a problem. I think there is something in CURLINFO_VERBOSEthat uses this option and just suppresses VERBOSE information ...
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, fopen('log.log', 'a+'));
Just to mention, you can use:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, fopen('log.log', 'a+'));
If you want to log the output to a file and still be able to return curl_exec.
source
share