Support » Plugin: Safe SVG » Can’t install due to error

  • Resolved Fabio Devin


    I’m trying to install the plugin. After downloading, once I try to activate it, I get this error message:

    Class ‘DOMDocument’ not found in /var/www/html/wp-content/plugins/safe-svg/lib/vendor/enshrined/svg-sanitize/src/Sanitizer.php on line 78

    any idea on what could be going on?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Has it ever worked for you before? If I was to make a stab in the dark, I’m wondering if another plugin is using the Sanitizer class and perhaps it is out-of-date.

    I’ve had this issue with plugins that autoload dependencies. Let’s say 2 plugins require a piece of code, but one author hasn’t updated it in ages. Eventually there are deprecation issues galore.

    That’s just a theory, though. The only way to know for sure would be a find+replace and disable other plugins, reactivating them one at a time to see if one collides.

    Thank you Hendridm for your fast response!

    Anyways, no, it’s a fresh installation. I tried disabling all plugins and even changed to TwentySeventeen from the custom theme I have installed, but it didn’t work.

    However, now that I think about it, I’m using EWWW Image Optimizer, and it found out I didn’t have some image libraries installed (which I installed later). Is it possible that I’m missing some other library here? And if so, what should I look for?

    Plugin Author Daryll Doyle


    Hi @fdevin,

    Yep, you’re correct in thinking that it’s a missing library. DOMDocument is what’s used by the sanitiser to work it’s way through the SVG file (

    This is something that will need to be installed for the sanitiser to work at all but should exist by default in all PHP 5+ versions.

    Do you know what PHP version you’re using. If it’s a 5.x or 7.x version then it should just be a case of installing the DOM extension into PHP as answered in this Stack Overflow question:

    Hope that helps 🙂


    Thank you Daryl, I think that is the case because I see I don’t have DOM installed. Sadly I don’t have root accesst o CentOS so I’ll need to wait, but I’m almost sure this is what I need, thank you again! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t install due to error’ is closed to new replies.