473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

failed to open stream problem

26
Hi all,

I was wondering why I always get "failed to open stream: HTTP request failed!" error in either loading a normal or xml file. i don't understand why i can't get the whole result. the result i get is only some part of the respective url (the one i tried to load). The following is my php code to open the file:

[PHP]$file= fopen('http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=2 ',"r");[/PHP]

This is the result i get from the code above (the underlined text is part of the result):
PHP Warning: fopen(http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=2 ) [function.fopen]: failed to open stream: HTTP request failed! $5$14:04:41,14:04:41,14:04:41,14:04:41,14:04:41$0. 0,0.0,0.0,0.0,0.0$Depart on,Turn sharp left onto,Continue on,Turn right onto in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 12

While the following is my php code to load the xml page:
[PHP]$clients = simplexml_load_file('http://localhost/mapguide/phpviewersample/cobacoba.xml');

echo $clients->routeType; [/PHP]

The following is the result i get from the code above (the underlined text is part of the result):

PHP Warning: simplexml_load_file(http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 ) [function.simplexml-load-file]: failed to open stream: HTTP request failed! <?xml version="1.0" ?> in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 :1: parser error : Document is empty in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: ^ in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 :1: parser error : Start tag expected, '<' not found in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: ^ in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Notice: Trying to get property of non-object in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 3
I hope somebody can help me out from this issue.
Anyway, Merry Christmas....

Thank you

Regards,
Kencana
Dec 26 '06 #1
1 4662
kencana
26
Hi all,

sorry there is small mistake in accessing xml file code...
the following is my final code:

[PHP]$clients = simplexml_load_file('http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 ');

echo $clients->routeType;[/PHP]

Thanks...

Regards,
Kencana
Dec 26 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Barti | last post by:
After upgrading php from 4.2.3 to 4.3.4 I have problem with "failed to open stream" Warning: main(): Failed opening '...........inc.php' for inclusion...
2
by: simbarashe | last post by:
Hie I'm trying to pass variables between pages using URLs however I am encountering the following error when I do so: Warning: main(jobSheetDisplay.php?id=20071403PB136CoA) : failed to open...
5
by: xieliwei | last post by:
I have a freshly installed openSuSe 10.2 with PHP4 from http://download.opensuse.org/repositories/home:/michal-m:/php4/openSUSE_10.2/ (openSuSe abandoned PHP4 since version 10, but I have customers...
6
by: Andy2500 | last post by:
Hi, I'd like to upload an image to a folder, then I have 3 diffrents examples but all of them give an error "failed to open stream: Permission denied", althrough the C:\Inetpub\wwwroot is not...
2
by: swethak | last post by:
Hi, when i run my code it gives error as fopen(lib/providers//provider.RVLogic.php): failed to open stream: Permission denied in F:\Facebook\furniture11\Data...
5
by: tyakimov | last post by:
Hi guys I got a problem On my IIS server I changed the password for the Internet Guest Account 'IUSR_Machine' and suddenly the PHP part of the intranet stopped working. - '... failed to open...
5
by: phpnewbie26 | last post by:
I've been having trouble trying to open a file. It outputs fopen(/projects/CCPROT/ts_classes) : failed to open stream: No such file or directory in /mnt/raid/www/intra/admin/ts2/test2.php on line 72...
0
by: RobUK | last post by:
We have Apache on the local network managing several websites that are accessed using virtual domains (configured in the local machine's hosts file, eg. 192.168.1.10 points to dev.somedomain.com). ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.