Skip to Content

Class ’DOMDocument’ not found

Error: Class 'DOMDocument' not found


Overview: This article describes resolving the error "Class 'DOMDocument' not found" by installing either php-dom or php-xml, essential PHP extensions enabling XML manipulation for SAML functionality in the specified file path.


- Getting an error on clicking the SAML tab 

Class 'DOMDocument' not found /var/www/ezlogin/application/third_party/saml/lib/IdPMetadataParser.php

- To resolve the error message "Class 'DOMDocument' not found" in PHP when working with SAML and encountering issues with IdPMetadataParser.php, you need to install the necessary PHP extension php-dom or php-xml. These extensions provide support for XML manipulation, which includes the DOMDocument class required by your SAML library.

Step 1. Installing php-dom or php-xml will solve the problem.

  • For Ubuntu/Debian:

:~# apt update && apt install php-dom

  • For CentOS/RHEL:

:~# yum install php-dom

Step 2. Restart the web server after installing 

:~# systemctl restart apache2


Related Articles:

Error log files and configuration files to troubleshoot.