attaboy Posted May 16, 2012 Share Posted May 16, 2012 PHP v. 5.3.8 What is libxml extension and how would I know if it's enabled? My book told me Note To take advantage of SimpleXML, make sure PHP's libxml extension is enabled. Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/ Share on other sites More sharing options...
scootstah Posted May 16, 2012 Share Posted May 16, 2012 libxml is a library that a bunch of extensions (such as SimpleXML) depend on. So if libxml is not installed, those extensions won't work. Both libxml and SimpleXML are included by default with modern PHP versions, and must be explicitly disabled. You should be pretty safe to rely on them. Any shared host worth a damn will have them enabled, and they are easy enough to switch on in a VPS/dedi environment. You can check for them, and any other PHP extension, by running this: <?php phpinfo(): ?> Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/#findComment-1346087 Share on other sites More sharing options...
attaboy Posted May 16, 2012 Author Share Posted May 16, 2012 it says LIBxml support is active but I get Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "world.xml" in C:\xampp\htdocs\segovia\load\songs.php on line 8 bool(false) this is the xml <?xml version="1.0" encoding="utf-8"?> <world> <continents> <NorthAmerica> <country>US</country> <country>Mexico</country> <country>Canada</country> </NorthAmerica> <SouthAmerica> <country>Equidor</country> <country>Peru</country> <country>Argentina</country> </SouthAmerica> </continents> </world> and this is my code: <?php $xml = simplexml_load_file("world.xml"); var_dump($xml); ?> Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/#findComment-1346107 Share on other sites More sharing options...
scootstah Posted May 16, 2012 Share Posted May 16, 2012 Does "world.xml" exist in the same directory as that script? Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/#findComment-1346114 Share on other sites More sharing options...
attaboy Posted May 16, 2012 Author Share Posted May 16, 2012 yes it is Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/#findComment-1346136 Share on other sites More sharing options...
scootstah Posted May 16, 2012 Share Posted May 16, 2012 What do these give you? var_dump(file_exists('world.xml'), is_readable('world.xml')); Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/#findComment-1346143 Share on other sites More sharing options...
attaboy Posted May 16, 2012 Author Share Posted May 16, 2012 on the other hand no it wasn't. thanks scootstah!! I managed to screw up a site in Dreamweaver I had 2 identical directory's in different places I totally faked myself out. Quote Link to comment https://forums.phpfreaks.com/topic/262634-what-is-libxml-extension/#findComment-1346144 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.