• I just set up a new server running Ubuntu version 22.04 LTS, with Apache version 2.4.52, MySQL version 8.0.30-0ubuntu0.22.04.1, and PHP version 8.1.2. I then installed the latest version of WordPress, version 6.0.1.

    I installed all the plugins, and the theme I wanted, but when I tried to import my images from my test sites, I got errors on the SVG files, but no other images. I then tried to upload the SVG files individually, and received this error…

    Fatal error: Uncaught Error: Class "DOMDocument" not found in /var/www/valleypl/wp-content/plugins/safe-svg/vendor/enshrined/svg-sanitize/src/Sanitizer.php:94 Stack trace: #0 /var/www/valleypl/wp-content/plugins/safe-svg/vendor/enshrined/svg-sanitize/src/Sanitizer.php(198): enshrined\svgSanitize\Sanitizer->resetInternal() #1 /var/www/valleypl/wp-content/plugins/safe-svg/safe-svg.php(180): enshrined\svgSanitize\Sanitizer->sanitize() #2 /var/www/valleypl/wp-content/plugins/safe-svg/safe-svg.php(145): safe_svg->sanitize() #3 /var/www/valleypl/wp-includes/class-wp-hook.php(307): safe_svg->check_for_svg() #4 /var/www/valleypl/wp-includes/plugin.php(191): WP_Hook->apply_filters() #5 /var/www/valleypl/wp-admin/includes/file.php(802): apply_filters() #6 /var/www/valleypl/wp-admin/includes/file.php(1074): _wp_handle_upload() #7 /var/www/valleypl/wp-admin/includes/media.php(303): wp_handle_upload() #8 /var/www/valleypl/wp-admin/media-new.php(33): media_handle_upload() #9 {main} thrown in /var/www/valleypl/wp-content/plugins/safe-svg/vendor/enshrined/svg-sanitize/src/Sanitizer.php on line 94

    Please advise…

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darin Kotter

    (@dkotter)

    @kburnett01 Thanks for the report. Based on that error message, your PHP install does not have the DOM library installed. This is required for this plugin to function correctly.

    I was under the impression this came pretty much standard in any PHP install but obviously not in all cases. There are a few approaches to getting this installed and depends on your hosting situation and level of access there. See this thread for some approaches you can take to install that.

    Thread Starter kburnett01

    (@kburnett01)

    Thanks for the tip… it pointed me in the right direction. I tried php8-dom and it gave me an error message indicating I should install the php8-xml library, so thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal Error on Upload of SVG File’ is closed to new replies.