How to add PHP DOMDocument extension to httpd in CentOS 7?

Just migrated a PHP site to a new server. However, in /var/log/httpd/error_log, there are errors like

[:error] [pid 2810] [client 61.92.242.24:43372] PHP Fatal error: Class 'DOMDocument' not found in /var/www/.../some.php on line 16

How to add PHP DOMDocument extension to httpd in CentOS 7?

asked Aug 17 by anonymous

1 Answer

You need to install the package php-xml to have DOMCoument support to PHP:

# yum install php-xml

You may need to restart apache/httpd (# apachectl restart).

The package contains:

$ rpm -ql php-xml
/etc/php.d/dom.ini
/etc/php.d/wddx.ini
/etc/php.d/xmlreader.ini
/etc/php.d/xmlwriter.ini
/etc/php.d/xsl.ini
/usr/lib64/php/modules/dom.so
/usr/lib64/php/modules/wddx.so
/usr/lib64/php/modules/xmlreader.so
/usr/lib64/php/modules/xmlwriter.so
/usr/lib64/php/modules/xsl.so
answered Aug 17 by Eric Z Ma (43,420 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...