mod_fcgid: stderr: PHP Fatal error: Class ‘DOMDocument’

You need to install the DOM extension. You can do so on CentOS using:

For php 5.x

yum install php-xml

For php 7.1

yum install php71w-xml

For php 7.2

yum install php7.2-xml

Restart Apache!

systemctl restart httpd

Enjoy!


Fatal error: Uncaught Error: Class "DOMDocument" not found in /home/nciaari7/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Model/FrontImage.php:67 Stack trace: #0 /home/nciaari7/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Model/FrontImage.php(41): ShortPixel\Model\FrontImage->loadImageDom() #1 /home/nciaari7/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Controller/Front/CDNController.php(568): ShortPixel\Model\FrontImage->__construct() #2 /home/nciaari7/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Controller/Front/CDNController.php(366): ShortPixel\Controller\Front\CDNController->extractImageMatches() #3 [internal function]: ShortPixel\Controller\Front\CDNController->processFront() #4 /home/nciaari7/public_html/wp-includes/functions.php(5493): ob_end_flush() #5 /home/nciaari7/public_html/wp-includes/class-wp-hook.php(341): wp_ob_end_flush_all() #6 /home/nciaari7/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() #7 /home/nciaari7/public_html/wp-includes/plugin.php(522): WP_Hook->do_action() #8 /home/nciaari7/public_html/wp-includes/load.php(1308): do_action() #9 [internal function]: shutdown_action_hook() #10 {main} thrown in /home/nciaari7/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Model/FrontImage.php on line 67