barry769 Posted January 10, 2009 Share Posted January 10, 2009 I have some code that I have been using for some time on my old server running 5.1.2. I changed to a new server running php 5.2.6 and now it is giving me an error. $xml = new SimpleXMLElement("http://www.example.com/basic/file.xml", null, true); SimpleXMLElement::__construct() [<a href='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: WARNING: URL fopen access in <b>/file.php</b> on line <b>25</b><br /> Is there a change that I don't know about that is causing this, or am I just going crazy? Link to comment https://forums.phpfreaks.com/topic/140340-simplexmlelement-problem/ Share on other sites More sharing options...
xtopolis Posted January 11, 2009 Share Posted January 11, 2009 url fopen is probably disabled, with good reason to. Link to comment https://forums.phpfreaks.com/topic/140340-simplexmlelement-problem/#findComment-734438 Share on other sites More sharing options...
barry769 Posted January 11, 2009 Author Share Posted January 11, 2009 url fopen is probably disabled, with good reason to. would you care to explain the reason for that? also, what can I do to get around that issue if it really is a problem. I need a solution for this really quick since this is a website for a customer and they are pestering me as to why its not working as well as it was before I switched servers. Link to comment https://forums.phpfreaks.com/topic/140340-simplexmlelement-problem/#findComment-734487 Share on other sites More sharing options...
xtopolis Posted January 11, 2009 Share Posted January 11, 2009 "url fopen" means opening a url/file to a remote site. This is bad because you can never trust a remote source, and even if you can, you never should. That being said, you can still access remote files by using cURL. cURL is easy to use, just look at the examples. Since you're only reading a file, it should be easy to implement into your current solution. Link to comment https://forums.phpfreaks.com/topic/140340-simplexmlelement-problem/#findComment-734500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.