#39841 [Opn]: fopen is not opening external urls but opening local files
ID: 39841
User updated by: sarvesh_borkar at yahoo dot co dot in
Reported By: sarvesh_borkar at yahoo dot co dot in
Status: Open
Bug Type: Filesystem function related
-Operating System: FreeBSD
+Operating System: FreeBSD(server operating system)
PHP Version: 5.2.0
New Comment:
FreeBSD is SERVER SYSTEM
Previous Comments:
------------------------------------------------------------------------
[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
Thread (7 messages)