php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10996 fopen of url results in invlaid file handle
Submitted: 2001-05-21 14:19 UTC Modified: 2001-12-17 05:01 UTC
From: giwarden at ucla dot edu Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.5 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: giwarden at ucla dot edu
New email:
PHP Version: OS:

 

 [2001-05-21 14:19 UTC] giwarden at ucla dot edu
#!/usr/local/bin/php
<?php
$fp = fopen("php://stdin", "r"); #same result with a file
$text = fread($fp, 100);
fclose($fp);
$fp2 = fopen("http://cnn.com", "r");
$text2 = fread($fp2, 100);
fclose($fp2);
?>

CGI version of php 4.0.5 (4.0.2 did the same too) with default "./configure"

default php.ini too

The URL fopen usually goes through (meaning the server of the called URL usually gets the request), but the response is unreadable since the file-handle isn't valid. If I'm missing something totally obvious I apologize in advance. Thanks so much. 
-Graham Warden

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-21 14:41 UTC] sniper@php.net
Reproduced with PHP 4.0.6RC1.

--Jani


 [2001-12-17 02:32 UTC] alan_k@php.net
tested this with 4.2.0-dev and appears to be fixed.

could somebody check with 4.1.0?

 [2001-12-17 05:01 UTC] edink@php.net
This has been fixed in PHP 4.1.0
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 14:01:30 2025 UTC