Linux

How to fix PHP Fatal error: Class ‘DOMDocument’ not found in /var/www/html/index.php on line 171 or similar error

Written by Ian Carnaghan · 11 sec read >
  • Knowledge Base
  • Linux
  • How to fix PHP Fatal error: Class 'DOMDocument' not found in /var/www/html/index.php on line 171 or similar error

NOTE: Received this error on a Centos 5 environment while trying to run a PHP script that makes use of the DOMDocument class

 

In the CLI (Command Line Interface) run the following command

{codecitation class=”brush: shell;”}
yum install php-xml
{/codecitation}

This will install XML support and will solve the DOMDocument issue

Last Updated On April 07, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. In my spare time I teach undergraduate classes in web development. Profile

Leave a Reply

avatar
  Subscribe  
Notify of