Jump to content

Can't seem to get DOM enabled on PHP5


kendhal

Recommended Posts

Folks,

This is driving me crazy.  I have PHP5.2.6 running on linux and have DOM enabled as shown below in my phpinfo call:

DOM/XML enabled

DOM/XML API Version 20031129

libxml Version 2.6.32

HTML Support enabled

XPath Support enabled

XPointer Support enabled

Schema Support enabled

RelaxNG Support enabled

 

I have also checked ith "php -i | grep configure" and everything seems to be in place but

The simple PHP code below gives me the following error:

"Fatal error: Call to undefined method DOMNodeList::getElementsByTagName()"

 

  $dom = new DomDocument();

  $dom->load("articles.xml");

  $titles = $dom->getElementsByTagName("title");

  foreach($titles as $node) {

    print $node->textContent . " ";

  }

 

Can anyone shed some light on this?  Thanks a ton.

 

KD

Link to comment
https://forums.phpfreaks.com/topic/124775-cant-seem-to-get-dom-enabled-on-php5/
Share on other sites

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.