php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39841 fopen is not opening external urls but opening local files
Submitted: 2006-12-15 05:56 UTC Modified: 2006-12-15 11:45 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sarvesh_borkar at yahoo dot co dot in Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.2.0 OS: FreeBSD(server operating system)
Private report: No CVE-ID: None
 [2006-12-15 05:56 UTC] sarvesh_borkar at yahoo dot co dot in
Description:
------------
The following code is used to fetch the news from rss and read
that news into the variable and the xml parsing and all that stuff.

This code works fine on PHP Version 4.3.11 and 
system:Linux web147.opentransfer.com 2.6.14.7 #1 Fri Sep 8 11:12:28 CDT 2006 i686

but fails on
PHP Version 5.1.6
system :FreeBSD pro29.abac.com 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Mon Nov 13 17:47:40 PST 2006 root@bak5.abac.com:/var/obj/usr/src/sys/PRO6 i386




Reproduce code:
---------------
//below url is dynamic through database
$url="http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/front_page/rss.xml"; 

$fp=fopen($url,"rb") or die("file not opened") ;
    do {
        $data = fread($fp, 8192);
        if (strlen($data) == 0) {
        break;
      }
     $simple .= $data;
      } while(true);

    fclose($fp);

Expected result:
----------------
we expect to see the news in formatted manner which is working fine on PHP Version 4.3.11 

Actual result:
--------------
file not opened

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-15 06:07 UTC] sarvesh_borkar at yahoo dot co dot in
FreeBSD is SERVER SYSTEM
 [2006-12-15 09:53 UTC] tony2001@php.net
Set allow_url_fopen to On.
If that doesn't help - check the firewall.
Not PHP problem.
 [2006-12-15 10:24 UTC] sarvesh_borkar at yahoo dot co dot in
I m trying out that
 [2006-12-15 10:33 UTC] tony2001@php.net
Ok. 
Still not PHP problem.
 [2006-12-15 11:07 UTC] sarvesh_borkar at yahoo dot co dot in
allow_url_fopen is set to On.
so i think it is a firewall problem only
 [2006-12-15 11:45 UTC] tony2001@php.net
Great. 
Please don't reopen the report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 04:01:30 2024 UTC