php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21873 cURL not work with tmpfile
Submitted: 2003-01-25 02:23 UTC Modified: 2003-03-18 09:52 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: SiberianGhost at hotmail dot com Assigned:
Status: Closed Package: cURL related
PHP Version: 4.3.1-dev OS: FreeBSD 4.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: SiberianGhost at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-01-25 02:23 UTC] SiberianGhost at hotmail dot com
This function return empty result. In PHP 4.2.1 all work correctly.

function _HttpsReq($addr)
{
  $ch = curl_init("https://192.0.0.1".$addr);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  $fp = tmpfile();
//  fwrite($fp," ");
  curl_setopt ($ch, CURLOPT_FILE, $fp);
  curl_exec($ch);
  curl_close($ch);
  fseek($fp,0,SEEK_SET);
  $result = fgets($fp,1024);
  fclose($fp);
  return $result;
} //return empty result

When i uncomment string fwrite($fp," "); All work correctly.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-25 03:39 UTC] SiberianGhost at hotmail dot com
It's fseek BUG
Whe i modify code to
fseek($fp,1,SEEK_SET);
fseek($fp,0,SEEK_SET);

All work correctly
 [2003-02-12 03:33 UTC] SiberianGhost at hotmail dot com
After try php4-STABLE-200302120830
Nothing changed.
fseek($fp,0,SEEK_SET); not work.
Version 4.2.1 work correct

Config command:
./configure --prefix=/home/u6394/php --with-mysql=/usr/local --with-zlib --with-config-file-path=/home/u6394/php43 --with-gd --with-jpeg-dir=/usr/local --with-t1lib --disable-debug --enable-force-cgi-redirect --with-mod_charset --without-pear  --disable-rpath --enable-sockets with-openssl --with-curl=/home/u6394/curl

Module tested:
sapi/cgi/php
 [2003-02-12 23:31 UTC] sniper@php.net
Verified with this script: 

<?php

$ch = curl_init("https://solo3.merita.fi/cgi-bin/SOLO0001");
curl_setopt($ch, CURLOPT_HEADER, 0);
$fp = tmpfile();
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
// fseek($fp,1,SEEK_SET); // uncomment this and it works..
fseek($fp,0,SEEK_SET);
$result = fgets($fp,1024);
fclose($fp);

var_dump($result);

?>

Outputs:
bool(false)

 [2003-02-27 09:58 UTC] 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

Appears to have been fixed, cannot replicate using latest CVS.
 [2003-03-09 18:50 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-03-18 04:18 UTC] SiberianGhost at hotmail dot com
After try php4-4.3.1
Nothing changed.
fseek($fp,0,SEEK_SET); not work.

After try php4-STABLE-200303180830 (4.3.2RC) work correct
Version 4.2.1 work correct
 [2003-03-18 09:52 UTC] magnus@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

User reported php4-STABLE-200303180830 works.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 13:01:31 2024 UTC