Title: PHP Fatal error: Uncaught ValueError
Last modified: November 26, 2021

---

# PHP Fatal error: Uncaught ValueError

 *  [Marc Tönsing](https://wordpress.org/support/users/marcdk/)
 * (@marcdk)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/)
 * i get this error when an amp page is called. My error log is spammed with this.
 *     ```
       thrown in plugins/accelerated-mobile-pages/templates/features.php on line 8283
       PHP Fatal error:  Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in 
       Stack trace:
       #0 wp-content/plugins/accelerated-mobile-pages/templates/features.php(8283): DOMDocument->loadHTML('')
       #1 /wp-includes/class-wp-hook.php(303): ampforwp_remove_duplicate_canonical('')
       #2 wp-includes/plugin.php(189): WP_Hook->apply_filters('', Array)
       #3 wp-content/plugins/accelerated-mobile-pages/includes/features/functions.php(280): apply_filters('ampforwp_the_co...', '')
       #4 [internal function]: ampforwp_the_content_filter_full('', 9)
       #5 wp-includes/functions.php(5107): ob_end_flush()
       #6 wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all('')
       #7 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array)
       #8 /wp-includes/plugin.php(470): WP_Hook->do_action(Array)
       #9 /wp-includes/load.php(1097): do_action('shutdown')
       #10 [internal function]: shutdown_action_hook()
       #11 {main}
         thrown in wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 8283
       ```
   
 * The amp pages look fine
    -  This topic was modified 4 years, 6 months ago by [Marc Tönsing](https://wordpress.org/support/users/marcdk/).
    -  This topic was modified 4 years, 6 months ago by [Marc Tönsing](https://wordpress.org/support/users/marcdk/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-fatal-error-uncaught-valueerror-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/#post-15112346)
 * Can you please let me know, is the DOM extension is not activated on the server?
 *  Thread Starter [Marc Tönsing](https://wordpress.org/support/users/marcdk/)
 * (@marcdk)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/#post-15112368)
 * It is. My very own plugins use that, too. The server uses php 8. Does that help?
 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/#post-15112420)
 * But we already have this code – @$comp_dom->loadHTML($content);
 *  Thread Starter [Marc Tönsing](https://wordpress.org/support/users/marcdk/)
 * (@marcdk)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/#post-15112557)
 * new in php8:
 * > The @ operator no longer silences fatal errors
 * They are silenced with display_errors=Off but they appear in the log
    -  This reply was modified 4 years, 6 months ago by [Marc Tönsing](https://wordpress.org/support/users/marcdk/).
 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/#post-15117311)
 * Alright, For this we have raised a GitHub ticket in our repository. Our developer
   will work on it and push it in the further update.
 * For reference please followup the following ticket:
    [https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/5174](https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/5174)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Fatal error: Uncaught ValueError’ is closed to new replies.

 * ![](https://ps.w.org/accelerated-mobile-pages/assets/icon-256x256.png?rev=1693616)
 * [AMP for WP - Accelerated Mobile Pages](https://wordpress.org/plugins/accelerated-mobile-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accelerated-mobile-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accelerated-mobile-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/accelerated-mobile-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accelerated-mobile-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accelerated-mobile-pages/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-valueerror-2/#post-15117311)
 * Status: not resolved