#27341 [Csd->Opn]: CURLOPT_RETURNTRANSFER and CURLOPT_CUSTOMREQUEST incompatibility?
ID: 27341
User updated by: matteo at beccati dot com
Reported By: matteo at beccati dot com
-Status: Closed
+Status: Open
Bug Type: cURL related
Operating System: Win32 - Linux
-PHP Version: 4.3.4
+PHP Version: 4.3.5-dev
New Comment:
Just downloaded the latest win32 snapshot (STABLE-200402231730), and
tried the code with http://bugs.php.net/ (which is a PHP script)
and an
image file (http://bugs.php.net/gifs/logo-bug.gif).
The issue still exists when doing HEAD requests to static files.
Previous Comments:
------------------------------------------------------------------------
[2004-02-21 12:19:57] iliaa@php.net
Works just fine with latest CVS.
<?php
$ch = curl_init('http://bugs.php.net/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
var_dump(curl_exec($ch));
?>
Results in:
tring(154) "HTTP/1.1 200 OK
Date: Sat, 21 Feb 2004 17:19:33 GMT
Server: Apache/1.3.28 (Unix) PHP/4.3.4-dev
X-Powered-By: PHP/4.3.4-dev
Content-Type: text/html
"
------------------------------------------------------------------------
[2004-02-21 10:15:24] derick@php.net
Interesting :)
------------------------------------------------------------------------
[2004-02-21 08:30:19] daniel at haxx dot se
I beg to differ.
CURLOPT_RETURNTRANSFER is not an option that libcurl provides, it is an
option that the PHP/CURL layer has invented and uses.
Thus, we cannot fix this in the curl project. It is not a curl bug!
------------------------------------------------------------------------
[2004-02-21 04:10:55] matteo at beccati dot com
> Ask the curl author(s).
Done.
http://sourceforge.net/tracker/index.php?func=detail&aid=901648&group_id=976&atid=100976
> Not PHP bug (if it even is a bug which I doubt).
You're probabiliy correct saying that it's not a PHP bug, but it really
seems a wrong cURL behaviour to me.
When setting CURLOPT_RETURNTRANSFER I'm asking curl_exec to return the
result instead that outputting it, but result isn't returned, neither
printed out.
Thank you for your help.
------------------------------------------------------------------------
[2004-02-21 02:57:08] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Not PHP bug (if it even is a bug which I doubt).
Ask the curl author(s).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/27341
--
Edit this bug report at http://bugs.php.net/?id=27341&edit=1
Thread (10 messages)