#22517 [Bgs]: CURL does not work using curl_setopt($curl, CURLOPT_FILE, $fp);
| From: | jacques@php.net | Date: | Tue, 04 Mar 2003 01:03:00 +0000 |
| Subject: | #22517 [Bgs]: CURL does not work using curl_setopt($curl, CURLOPT_FILE, $fp); | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-34714@lists.php.net to get a copy of this message | ||
ID: 22517
Updated by: jacques@php.net
Reported By: jacques@php.net
Status: Bogus
Bug Type: cURL related
Operating System: FreeBSD 4.7-(STABLE|RELEASE)
PHP Version: 4.3.0/4.3.1/4.3.2-dev
New Comment:
Apart from (b) with the SSL stuff, part (a) where $fp does not get
anything from the CURL session for example if I do something like
following, $fp does not get any data using the CURLOPT_FILE setopt
setting:
<?php
$saix_url = "http://isp.saix.net/cgi-bin/ISPUserHistory.pl";
$fp = tmpfile();
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $saix_url);
curl_setopt($curl, CURLOPT_TIMEOUT, 2000);
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($curl, CURLOPT_USERPWD, $saix['login']);
curl_setopt($curl, CURLOPT_PROXY, "http://192.168.253.14:3128/");
curl_exec($curl);
curl_close($curl);
Adding the following option and adding a
$get_ouptut_since_fp_contains_no_data = in front of the curl_exec call
seems to get the data that $fp should have contained.
$fp = tmpfile();
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $saix_url);
curl_setopt($curl, CURLOPT_TIMEOUT, 2000);
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($curl, CURLOPT_USERPWD, $saix['login']);
curl_setopt($curl, CURLOPT_PROXY, "http://192.168.253.14:3128/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$get_output_since_fp_contains_no_data = curl_exec($curl);
curl_close($curl);
...
I'm going to play around with the curl extension and see if I can come
up with a patch to fix the CURLOPT_FILE stuff.
Previous Comments:
------------------------------------------------------------------------
[2003-03-03 17:18:15] edink@php.net
Not a PHP bug but a feature of the new version of libcurl.
As Daniel pointed out have a look at:
http://curl.haxx.se/docs/sslcerts.html
------------------------------------------------------------------------
[2003-03-03 17:13:53] daniel at haxx dot se
http://curl.haxx.se/docs/sslcerts.html
------------------------------------------------------------------------
[2003-03-03 14:46:14] jacques@php.net
Still same problems with the latest php4 STABLE which I downloaded this
afternoon.
root@mimbari:/usr/local/src/php4-STABLE-200303031230/sapi/cli# ./php
-v
PHP 4.3.2-dev (cli) (built: Mar 3 2003 21:54:28)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend
Technologies
------------------------------------------------------------------------
[2003-03-03 13:35:24] jacques@php.net
Busy building the latest stable which I downloaded earlier today. Will
keep you guys posted on the status.
------------------------------------------------------------------------
[2003-03-03 09:30:41] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
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/22517
--
Edit this bug report at http://bugs.php.net/?id=22517&edit=1