Jump to content

What is libxml extension?


attaboy

Recommended Posts

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(): ?>

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);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.