|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-05-13 10:41 UTC] divinity76 at gmail dot com
Description: ------------ curl_close() does not honor CURLOPT_STDERR if the curl handle has been doing HTTP requests, then it prints 3 lines to the actual stderr, regardless of what CURLOPT_STDERR is set to. i know PHP 7.0.12 is not affected, so it happened somewhere between 7.0.13 and 7.3.4 Test script: --------------- php -r '$ch=curl_init();$tmp=tmpfile();curl_setopt_array($ch,array(CURLOPT_VERBOSE=>1,CURLOPT_URL=>"http://gstatic.com/generate_204",CURLOPT_STDERR=>$tmp)); curl_exec($ch);curl_close($ch);fclose($tmp);' Expected result: ---------------- (blank) Actual result: -------------- $ php -r '$ch=curl_init();$tmp=tmpfile();curl_setopt_array($ch,array(CURLOPT_VER * Marked for [closure]: kill all * Closing connection 0 * The cache now contains 0 members PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 00:00:02 2025 UTC |
a PHP userland workaround, run this before calling curl_close: <?php if(true){ // workaround for https://bugs.php.net/bug.php?id=78007 curl_setopt_array( $ch, array(CURLOPT_VERBOSE=>0,CURLOPT_URL=>null)); curl_exec($ch); } curl_close ( $ch ); ?> .. exactly why i have to call curl_exec(), why it doesn't just work to just set CURLOPT_VERBOSE to 0, i don't know.