How to add PHP DOMDocument extension to httpd in CentOS 7?
Posted on In QAJust 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?
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