Page 1 of 1

URL file-access and SimpleXML

Posted: Mon Oct 23, 2006 6:25 am
by stefano22
For a project I am working on I need to get data from freedb2.org. The easiest way will probably be to use the xml feeds they provide.

I have tried to use php's simplexml function but of course I can't use:

Code: Select all

include 'http://www.freedb2.org/xml/whatever';

$xml = new SimpleXMLElement($xmlstr);
because I get this error

Code: Select all

URL file-access is disabled in the server configuration
The same is also true for:

Code: Select all

simplexml_load_file('http://www.freedb2.org/xml/whatever');
I have found a horrid way of getting it working use curl.

Is there a better way of doing this?

Re: URL file-access and SimpleXML

Posted: Mon Oct 23, 2006 6:56 am
by volka
stefano22 wrote:I have tried to use php's simplexml function but of course I can't use:

Code: Select all

include 'http://www.freedb2.org/xml/whatever';

$xml = new SimpleXMLElement($xmlstr);
because I get this error

Code: Select all

URL file-access is disabled in the server configuration
not "of course" but because of the server's configuration, see http://de2.php.net/manual/en/ref.filesy ... -url-fopen

btw: Where would $xmlstr come from in your first example? Does http://www.freedb2.org/xml/whatever return valid php code? I doubt it.