[RESOLVED] file_get_contents($xml)

liunx

Guest
hi

hi have a running php version 5

i'm using php to to handle xmlhhtp requests and get xml from a remote server and return it

so far I have a simple php scrpt



<?php

$xmlurl = "http://myserver/foo?sql=execute%20" . $_GET["sp"] . $_GET["vars"] . "&Root=" . $_GET["root"];

$get = file_get_contents("$xmlurl");

echo $get;

?>

so the the xmlhttp request calls a this php script, which calls the remote server, which returns the resulting XML

it works partially...

if there is only one reqest

AND

the result xml is small

!!!

if the xml is large I get 'Only one top level element is allowed in an XML document.'

if the xml is small, bu there are two simulataneous request, the resulting xml is usually the wrong way round AND only one of them completes

....

i'm guessing that this is two different problems

does anybody have any ideas what might be happening ?

cheers for looking

Garry

btw - if I request the larger xml sources directly from the broswer (bypassing the php) it returns the file has expected - only because of security issues we can't do this directly when it goes to production

if I query for the xml on the sql server, it returns three rows, so i guess the larger file problm is something to do with this this ?doh!

after wasting a whole day on this - it appears it was the ouput_buffer in php.ini

I had the buffer set 4096 which was way to small for the larger XML output, i now have something more friendly to me - 4096 is the default setting in the normal ditributed php-ini

it also seems to have resolved the the problem of simultaneous requests

there is is an overhead to incresing the buffer size, but it's not noticeable at this end.

phew!
 
Back
Top