View Full Version : reading an xml file from another domain and wrappers

01-02-2007, 12:45 PM
can anyone help with this php error.

"[Tue Jan 02 08:46:16 2007] [error] [client] PHP Warning: file(http://www.domain.com/stats/stats-daily.xml): failed to open stream: no suitable wrapper could be found in /var/www/html/statstest.php on line 3"

the code used to work no problem and my ISP claims they have done nothing but that can't be the case. Anyhow, I tried using php_stream_open_wrapper but got function not defined so that php extension doesn't exist on my ISP.

any clues on how to read an XML file from another domain avaoiding the wrapper error?

01-02-2007, 01:59 PM
check the output of phpinfo() and see if allow_url_fopen is on or off

01-02-2007, 02:49 PM
its off and I have been trying to set it on. My ISP is denying they've done anything but I used to be able to read files from other severs and now I can't.

01-03-2007, 12:19 AM
And thats the reason why :)
That setting stops you from using file, fopen, fsockopen etc with url's

All you can do is shout at your host.

01-03-2007, 04:20 AM
I know that the hosts want those things (and globals) turned off
for security reasons. You may have another way (worth at try).

Adding this: php_flag allow_url_fopen on

to your .htaccess file, may turn it back on.

01-03-2007, 11:41 AM
they have now turned it on. register globals is supposed to be off but its on.
I dont know what they've been doing. I think its got a lot to do with updates to ensim which sets everything nack to its defaults.

Anyhow, its fixed for now thanks.