Title: Class &#8216;DOMImplementation&#8217; not found
Last modified: June 29, 2018

---

# Class ‘DOMImplementation’ not found

 *  Resolved [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/)
 * I recently upgraded my server distribution, and after upgrading I get the following
   error whenever wp-typography is installed (from my experimentation it seems it
   doesn’t even have to be enabled). Do you know what could be wrong? Google did
   not turn up anything that helped me solve the problem.
 *     ```
       <b>Fatal error</b>:  Uncaught Error: Class 'DOMImplementation' not found in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php:169
       Stack trace:
       #0 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5.php(170): Masterminds\HTML5\Parser\DOMTreeBuilder->__construct(false, Array)
       #1 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5.php(98): Masterminds\HTML5->parse(Object(Masterminds\HTML5\Parser\StringInputStream), Array)
       #2 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php(231): Masterminds\HTML5->loadHTML('<!DOCTYPE html>...')
       #3 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php(149): PHP_Typography\PHP_Typography->parse_html(Object(Masterminds\HTML5), 'Body', Object(PHP_Typography\Settings in <b>/var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php</b> on line <b>169</b><br />
       ```
   
 * The error was only visible on the public page, not the admin page.
 * Thanks!
    -  This topic was modified 7 years, 11 months ago by [cmeeren](https://wordpress.org/support/users/cmeeren/).
    -  This topic was modified 7 years, 11 months ago by [cmeeren](https://wordpress.org/support/users/cmeeren/).
    -  This topic was modified 7 years, 11 months ago by [cmeeren](https://wordpress.org/support/users/cmeeren/).
    -  This topic was modified 7 years, 11 months ago by [cmeeren](https://wordpress.org/support/users/cmeeren/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fclass-domimplementation-not-found%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/class-domimplementation-not-found/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/class-domimplementation-not-found/page/2/?output_format=md)

 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10447067)
 * Either your libxml was compiled with `--disable-dom` or your PHP installation
   is missing the DOM extension.
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10447090)
 * Thanks for the prompt response! Indeed, the DOM extension was not enabled. I 
   added `extension=dom` to my php.ini and now it works.
 * Thanks again!
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10454468)
 * Hi, I’m having a similar problem that cropped up out of nowhere:
 *     ```
       <br />
       <b>Fatal error</b>:  Uncaught TypeError: Argument 2 passed to PHP_Typography\PHP_Typography::query_tags_to_ignore() must be an instance of DOMNode, null given, called in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php on line 159 and defined in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php:282
       Stack trace:
       #0 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php(159): PHP_Typography\PHP_Typography->query_tags_to_ignore(Object(DOMXPath), NULL, Object(PHP_Typography\Settings))
       #1 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php(103): PHP_Typography\PHP_Typography->process_textnodes('Body', Object(Closure), Object(PHP_Typography\Settings), true, Array)
       #2 /var/www/relativisticramblings.com/wp-content/plu in <b>/var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php</b> on line <b>282</b><br />
       ```
   
 * Do you have any idea what’s wrong?
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10455978)
 * Does this only happen with a specific page or are you experimenting with the 
   API? i’m wondering because of the `'Body'` argument to `process_textnodes`.
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10456270)
 * I’m not experimenting with anything. It happens with any page on my WP site as
   long as wp-typography is installed (regardless of whether or not it’s activated
   in the plugin listing).
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10458932)
 * That can’t be quite right. If wp-Typography were disabled, that code would not
   be executed. Could you describe your exact setup (OS, PHP version, HTTP server,
   singlesite/multisite etc.)? Also, could you try to expand the stack trace? It
   only goes back two levels, which does not reach the plugin code itself (only 
   the embeded `php-typography` library).
 * From that stacktrace, `$xpath->query( '/html/body' )->item( 0 );` returns `null`
   instead of a `DOMNode` object. That is weird because `<body>` tag is explicitly
   added around the parsed fragment, so that call should always return the outer-
   most `<body>` node that was added by the plugin.
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10459745)
 * > That can’t be quite right. If wp-Typography were disabled, that code would 
   > not be executed.
 * I’d think so too, but that’s not what I’m observing.
 * I’m using Ubuntu 18.04 LTS, PHP 7.2, Apache 2.4.29, single-site.
 * How can I expand the stack trace? To get the trace I posted, I just added the
   following to to index.php:
 *     ```
       ini_set('display_errors', 1);
       ini_set('display_startup_errors', 1);
       error_reporting(E_ALL);
       ```
   
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10459806)
 * Try [this Gist](https://gist.github.com/jrfnl/5925642). It will log to an error
   file instead of displaying the errors on the frontend. The output should include
   the complete stack trace.
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10459844)
 *     ```
       [03-Jul-2018 20:32:14 UTC] PHP Notice:  Undefined property: DOMDocument::$documentElement in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php on line 265
       [03-Jul-2018 20:32:14 UTC] PHP Notice:  Undefined property: DOMDocument::$documentElement in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php on line 265
       [03-Jul-2018 20:32:14 UTC] PHP Notice:  Undefined property: DOMDocument::$documentElement in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php on line 265
       [03-Jul-2018 20:32:14 UTC] PHP Notice:  Undefined property: DOMElement::$tagName in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php on line 650
       [03-Jul-2018 20:32:14 UTC] PHP Notice:  Undefined property: DOMElement::$tagName in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php on line 650
       [03-Jul-2018 20:32:14 UTC] PHP Notice:  Undefined property: DOMElement::$tagName in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php on line 650
       [03-Jul-2018 20:32:14 UTC] PHP Fatal error:  Uncaught TypeError: Argument 2 passed to PHP_Typography\PHP_Typography::query_tags_to_ignore() must be an instance of DOMNode, null given, called in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/$Stack trace:
       #0 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php(159): PHP_Typography\PHP_Typography->query_tags_to_ignore(Object(DOMXPath), NULL, Object(PHP_Typography\Settings))
       #1 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php(103): PHP_Typography\PHP_Typography->process_textnodes('Body', Object(Closure), Object(PHP_Typography\Settings), true, Array)
       #2 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/includes/wp-typography/class-implementation.php(406): PHP_Typography\PHP_Typography->process('Body', Object(PHP_Typography\Settings), true, Array)
       #3 /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/includes/wp-typography/class-implementation.php(300): WP_Typography\Implementation->process('Body', true, false, Object(PHP_Typography\Settings))
       #4 /var/www/relativisticramblings.com/wp-includes/class-wp-hook.php(288): WP_Typography\Implementation->process_title('Body')
       #5 /var/www/relativisticramblings.com/wp-includes/plugin.php(203): WP_Hook->apply_filters('Body', Array)
       #6 /var/www/relativisticramblings.com/wp-includes/post-template.php(158): apply_filters('the_title', 'Body', 138)
       #7 /var/www/relativisticramblings.com/wp-content/plugins/easy-google-fonts/includes/class-egf-register-options.php(815): get_the_title()
       #8 /var/www/relativisticramblings.com/wp-includes/class-wp-hook.php(286): EGF_Register_Options->get_custom_option_parameters(Array)
       #9 /var/www/relativisticramblings.com/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array)
       #10 /var/www/relativisticramblings.com/wp-content/plugins/easy-google-fonts/includes/class-egf-register-options.php(746): apply_filters('tt_font_get_opt...', Array)
       #11 /var/www/relativisticramblings.com/wp-content/plugins/easy-google-fonts/includes/class-egf-register-options.php(859): EGF_Register_Options::get_option_parameters()
       #12 /var/www/relativisticramblings.com/wp-content/plugins/easy-google-fonts/includes/class-egf-register-options.php(907): EGF_Register_Options::get_option_defaults()
       #13 /var/www/relativisticramblings.com/wp-content/plugins/easy-google-fonts/includes/class-egf-frontend.php(131): EGF_Register_Options::get_options(true)
       #14 /var/www/relativisticramblings.com/wp-includes/class-wp-hook.php(286): EGF_Frontend->enqueue_stylesheets('')
       #15 /var/www/relativisticramblings.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
       #16 /var/www/relativisticramblings.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
       #17 /var/www/relativisticramblings.com/wp-includes/script-loader.php(1447): do_action('wp_enqueue_scri...')
       #18 /var/www/relativisticramblings.com/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts('')
       #19 /var/www/relativisticramblings.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
       #20 /var/www/relativisticramblings.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
       #21 /var/www/relativisticramblings.com/wp-includes/general-template.php(2614): do_action('wp_head')
       #22 /var/www/relativisticramblings.com/wp-content/themes/twentysixteen/header.php(21): wp_head()
       #23 /var/www/relativisticramblings.com/wp-includes/template.php(688): require_once('/var/www/relati...')
       #24 /var/www/relativisticramblings.com/wp-includes/template.php(647): load_template('/var/www/relati...', true)
       #25 /var/www/relativisticramblings.com/wp-includes/general-template.php(41): locate_template(Array, true)
       #26 /var/www/relativisticramblings.com/wp-content/themes/twentysixteen/index.php(17): get_header()
       #27 /var/www/relativisticramblings.com/wp-includes/template-loader.php(74): include('/var/www/relati...')
       #28 /var/www/relativisticramblings.com/wp-blog-header.php(19): require_once('/var/www/relati...')
       #29 /var/www/relativisticramblings.com/index.php(21): require('/var/www/relati...')
       #30 {main}
         thrown in /var/www/relativisticramblings.com/wp-content/plugins/wp-typography/vendor/mundschenk-at/php-typography/src/class-php-typography.php on line 282
       ```
   
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10460492)
 * Please check your PHP ini files that `extension=dom.so` is not included twice.
   Also, the `libxml` extension is activated too, right?
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10461987)
 * I have now verified that `extension=dom.so` only appears once, and I have also
   added `extension=libxml.so` (which was not there before). I still get the same
   exception.
 * Also, the exception does not occur if the plugin is disabled. That simply seemed
   to be caused by caching; a few minutes after disabling the plugin, the site works.
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10462790)
 * Was there a time when wp-Typography worked correctly on your new server? Is the
   title of the page “Body”?
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10462846)
 * No, wp-typography never worked after the OS upgrade. Body is not the title of
   the page. [Here’s the page](https://www.relativisticramblings.com/) (though all
   subpages also stop working if I enable wp-typography).
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10464497)
 * Have you got any idea where that `Body` comes from? It’s a string that’s processed
   as a title (`the_title` filter hook), might be from a widget or some other small
   part of the page, but I could not find it there.
 *  Thread Starter [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * (@cmeeren)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/#post-10467124)
 * Sorry, I have no idea. A quick `grep -rnw '/path/to/relativisticramblings.com/'-
   e 'Body'` did not turn up anything that I’d consider relevant. Perhaps it’s a
   string in the DB.
    -  This reply was modified 7 years, 11 months ago by [cmeeren](https://wordpress.org/support/users/cmeeren/).

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/class-domimplementation-not-found/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/class-domimplementation-not-found/page/2/?output_format=md)

The topic ‘Class ‘DOMImplementation’ not found’ is closed to new replies.

 * ![](https://ps.w.org/wp-typography/assets/icon.svg?rev=2663995)
 * [wp-Typography](https://wordpress.org/plugins/wp-typography/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-typography/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-typography/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-typography/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-typography/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-typography/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [cmeeren](https://wordpress.org/support/users/cmeeren/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/class-domimplementation-not-found/page/2/#post-10474058)
 * Status: resolved