I am reading and going through the examples in the book "Beginning Ajax" by Wrox.
Pretty quickly I ran into trouble. I was unable to use the DOMDocument class in PHP.
The error I am getting is "Fatal error: Class 'DOMDocument' not found in /var/www/html/dev/ch3/test
After looking around the web, I found that usually it was because the PHP-XML was not installed on the server, so I installed that. Still no go.
I decided to try a more basic example from PHP.net (shown in the snippet) and also available here: http://us2.php.net/manual/en/function.dom-domdocument-savexml.php
but got the same error
Here is the URL to this code on the server:http://www.mvtimes.com/dev/ch3/test.php
We have PHP 5.1.6 installed with XML functionality enabled: http://www.mvtimes.com/info.php
Any insight or help would be greatly appreciated.
$doc = new DOMDocument('1.0');
// we want a nice output
$doc->formatOutput = true;
$root = $doc->createElement('book');
$root = $doc->appendChild($root);
$title = $doc->createElement('title');
$title = $root->appendChild($title);
$text = $doc->createTextNode('This is the title');
$text = $title->appendChild($text);
echo "Saving all the document:\n";
echo $doc->saveXML() . "\n";
echo "Saving only the title part:\n";