Title: Various widget &amp; block related PHP errors
Last modified: August 20, 2021

---

# Various widget & block related PHP errors

 *  [Antipole](https://wordpress.org/support/users/antipole/)
 * (@antipole)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/)
 * I have updated to WP 5.8 and am using PHP 7.4 and am seeing various PHP warnings&
   errors relating to blocks and widgets.
 * I have already changed the definition of ABSPATH in my wp-config.php file from:
   `
   define('ABSPATH', dirname(__FILE__) . '/');` to `define('ABSPATH', __DIR__ . '/');`
 * I am aware that WP 5.8 introduced new widget blocks but I have not started using
   that feature. I am assuming I do not have to install the classic widgets plugin
   for existing pages to continue working?
 * Below is a summary of the errors being logged. Any help will be much appreciated.
 *     ```
       (E1) Fatal error: Uncaught Error: Class 'WP_Widget' not found in /home/xxx...xxx/wp-includes/widgets/class-wp-widget-block.php:17
   
       (E2) Fatal error: require(): Failed opening required 'ABSPATHWPINC/blocks/archives.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/xxx...xxx/wp-includes/blocks/index.php on line 9
   
       (E3) Fatal error: Uncaught Error: Call to undefined function get_the_block_template_html() in /home/xxx...xxx/wp-includes/template-canvas.php:12
       ```
   
 * I am also seeing warnings that might give a clue
 *     ```
       (W1) Warning: require(ABSPATHWPINC/blocks/archives.php): failed to open stream: No such file or directory in /home/xxx...xxx/wp-includes/blocks/index.php on line 9
   
       (W2) Warning: Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in /home/xxx...xxx/wp-includes/blocks/index.php on line 9
   
       (W3) Warning: Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in /home/antipole/public_html/ovni-owners/wp-includes/blocks/index.php on line 9
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fvarious-widget-block-related-php-errors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Topher](https://wordpress.org/support/users/topher1kenobe/)
 * (@topher1kenobe)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-14789661)
 * I also had issues with 5.8 because the new widgets manager was causing problems.
   I went ahead and installed the classic widgets plugin and it fixed everything.
   I’d give that a go.
 *  Thread Starter [Antipole](https://wordpress.org/support/users/antipole/)
 * (@antipole)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-14806842)
 * Installed the classic widgets plugin and it may have helped a bit but I am still
   seeing errors and warnings above.
 *  [TKServer](https://wordpress.org/support/users/tkserver/)
 * (@tkserver)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-14917584)
 * Same here. I have classic widgets plugin installed but have:
 * `PHP Fatal error: Uncaught Error: Class 'WP_Widget' not found`
    `PHP Fatal error:
   require(): Failed opening required 'ABSPATHWPINC/blocks/archives.php'` `PHP Fatal
   error: Uncaught Error: Call to undefined function get_the_block_template_html()`
    -  This reply was modified 4 years, 8 months ago by [TKServer](https://wordpress.org/support/users/tkserver/).
 *  [Jason M](https://wordpress.org/support/users/ep0ch/)
 * (@ep0ch)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-15218747)
 * Using php 7.4 (not sure if that’s relative) but my 30+ WordPress sites all have
   errors like this:
 *     ```
       [04-Jan-2022 15:45:11 UTC] PHP Warning:  Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in /wp-includes/blocks/index.php on line 9
       [04-Jan-2022 15:45:11 UTC] PHP Warning:  Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in /wp-includes/blocks/index.php on line 9
       [04-Jan-2022 15:45:11 UTC] PHP Warning:  require(ABSPATHWPINC/blocks/archives.php): failed to open stream: No such file or directory in /wp-includes/blocks/index.php on line 9
       [04-Jan-2022 15:45:11 UTC] PHP Fatal error:  require(): Failed opening required 'ABSPATHWPINC/blocks/archives.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /wp-includes/blocks/index.php on line 9
       ```
   
 *  [janehrhardt](https://wordpress.org/support/users/janehrhardt/)
 * (@janehrhardt)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-15280230)
 * Is it stopping the normal operations of your website?
 * `(E3) Fatal error: Uncaught Error: Call to undefined function get_the_block_template_html()
   in /home/xxx...xxx/wp-includes/template-canvas.php:12`
 * This error is probably caused by a direct call to [https://example.com/wp-includes/template-canvas.php](https://example.com/wp-includes/template-canvas.php)
 * Nothing to be worried about, but it would be nice if WordPress prevented direct
   calls like that.
 *  [mrkawaii](https://wordpress.org/support/users/mrkawaii/)
 * (@mrkawaii)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-15298279)
 * Hello,
 * I am also getting the same php errors and warnings on my site. Is there a fix
   for this problem? Thanks
 *  [wiredafrican](https://wordpress.org/support/users/wiredafrican/)
 * (@wiredafrican)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-15569734)
 * We still getting these errors on many sites. Is there no solution yet?
 *  [liviagomes](https://wordpress.org/support/users/liviagomes/)
 * (@liviagomes)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-15702329)
 * I getting the same error on version 6.0.
 * Sometimes my clients’ orders appear with the date 01/Jan/1970, I can’t understand
   why this happens, e.g. in a total of more than 100 orders one or another fails.
 * So I updated the Woocommerce database to try to fix this and I also got these
   errors:
 *     ```
       Notice: Undefined index: HTTP_HOST in /home/DOMAIN/public_html/wp-content/plugins/NAME_PLUGIN/FILENAME on line 21
       Notice: Undefined index: HTTP_HOST in /home/DOMAIN/public_html/wp-content/plugins/NAME_PLUGIN/FILENAME on line 25
       Warning: Declaration of WCS_Query::get_endpoint_title($endpoint) should be compatible with WC_Query::get_endpoint_title($endpoint, $action = '') in /home/DOMAIN/public_html/wp-content/plugins/NAME_PLUGIN/woocommerce-subscriptions/includes/class-wcs-query.php on line 377
       Notice: Function register_rest_route was called <strong>incorrectly</strong>. The REST API route definition for <code>wc/v1/subscriptions/statuses</code> is missing the required <code>permission_callback</code> argument. For REST API routes that are intended to be public, use <code>__return_true</code> as the permission callback. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.5.0.) /home/DOMAIN/public_html/wp-includes/functions.php 5831
       Found 2 updates (wc_update_600_migrate_rate_limit_options, wc_update_600_db_version)
       Updating database  100% [==================================================================================================================================================================] 0:00 / 0:00
       ```
   
 * Someone knows about this errors?
 * Thanks a lot!

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

The topic ‘Various widget & block related PHP errors’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 8 participants
 * Last reply from: [liviagomes](https://wordpress.org/support/users/liviagomes/)
 * Last activity: [3 years, 12 months ago](https://wordpress.org/support/topic/various-widget-block-related-php-errors/#post-15702329)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
