#39841 [Opn->Bgs]: fopen is not opening external urls but opening local files

From: Date: Fri, 15 Dec 2006 10:33:13 +0000
Subject: #39841 [Opn->Bgs]: fopen is not opening external urls but opening local files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106388@lists.php.net to get a copy of this message
ID: 39841 Updated by: tony2001@php.net Reported By: sarvesh_borkar at yahoo dot co dot in -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: FreeBSD(server operating system) PHP Version: 5.2.0 New Comment: Ok. Still not PHP problem. Previous Comments: ------------------------------------------------------------------------ [2006-12-15 10:24:38] sarvesh_borkar at yahoo dot co dot in I m trying out that ------------------------------------------------------------------------ [2006-12-15 09:53:27] tony2001@php.net Set allow_url_fopen to On. If that doesn't help - check the firewall. Not PHP problem. ------------------------------------------------------------------------ [2006-12-15 06:07:00] sarvesh_borkar at yahoo dot co dot in FreeBSD is SERVER SYSTEM ------------------------------------------------------------------------ [2006-12-15 05:56:13] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39841&edit=1

« previous php.bugs (#106388) next »