PHP Fatal error: Class ‘DomDocument’
The following error occurs when trying DomDocument Object in PHP for XML operations: PHP Fatal error: Class ‘DomDocument’
Solution:
PHP.net Documentation
Introduction
The DOM extension is the replacement for the DOM XML extension from PHP 4. The extension still contains many old functions, but they should no longer be used. In particular, functions that are not object-oriented should be avoided. The extension allows you to operate on an XML document with the DOM API.Installation
There is no installation needed to use these functions; they are part of the PHP core.
Since the Installation section of the PHP site describes this module as already installed as part of the PHP core, one would think no other work would be required. But if you install a fresh copy of PHP/Apache and then try to run a script with these function calls, you will get several errors.
Basically many will tell you that you need to recompile php with the option to enable Dom Functions, but this is untrue. The following is all you should have to do in FC4:
Open the linux command line interface and type the following commands:
su root
yum install php-xml
Allow the installation to happen through YUM, restart Apache service (service httpd restart) and all should be well.