Title: PHP 8.x and Rest-API Error
Last modified: January 30, 2022

---

# PHP 8.x and Rest-API Error

 *  [Telefunki](https://wordpress.org/support/users/telefunki/)
 * (@telefunki)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-8-x-and-rest-api-error/)
 * Hi there,
 * I have 2 WP Pages running. One page uses PHP 7.4, the other one 8.0 in my function.
   php I disabled the Rest-API.
 * When I run the Page health tool, I don’t get any error on my site which PHP 7.4.
   On the other one with 8.0 I’ll get the following error message:
 * The Rest-API encountered an unexpected result:
 * > `The REST API is one way WordPress, and other applications, communicate with
   > the server. One example is the block editor screen, which relies on this to
   > display, and save, your posts and pages.
   > The REST API call gave the following unexpected result: (500) <!DOCTYPE html
   > > <html lang=”en-US”> <head> <meta http-equiv=”Content-Type” content=”text/
   > html; charset=UTF-8″ /> <meta name=”viewport” content=”width=device-width”>
   > <meta name=’robots’ content=’max-image-preview:large, noindex, follow’ /> <
   > title>WordPress › Error</title> <style type=”text/css”> html { background: #
   > f1f1f1; } body { background: #fff; border: 1px solid #ccd0d4; color: #444; 
   > font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Oxygen-
   > Sans, Ubuntu, Cantarell, “Helvetica Neue”, sans-serif; margin: 2em auto; padding:
   > 1em 2em; max-width: 700px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
   > box-shadow: 0 1px 1px rgba(0, 0, 0, .04); } h1 { border-bottom: 1px solid #
   > dadada; clear: both; color: #666; font-size: 24px; margin: 30px 0 0 0; padding:
   > 0; padding-bottom: 7px; } #error-page { margin-top: 50px; } #error-page p, #
   > error-page .wp-die-message { font-size: 14px; line-height: 1.5; margin: 25px
   > 0 20px; } #error-page code { font-family: Consolas, Monaco, monospace; } ul
   > li { margin-bottom: 10px; font-size: 14px ; } a { color: #0073aa; } a:hover,
   > a:active { color: #006799; } a:focus { color: #124964; -webkit-box-shadow: 
   > 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); box-shadow: 0 0 0 1px#
   > 5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); outline: none; } .button { background:#
   > f3f5f6; border: 1px solid #016087; color: #016087; display: inline-block; text-
   > decoration: none; font-size: 13px; line-height: 2; height: 28px; margin: 0;
   > padding: 0 10px 1px; cursor: pointer; -webkit-border-radius: 3px; -webkit-appearance:
   > none; border-radius: 3px; white-space: nowrap; -webkit-box-sizing: border-box;-
   > moz-box-sizing: border-box; box-sizing: border-box; vertical-align: top; } .
   > button.button-large { line-height: 2.30769231; min-height: 32px; padding: 0
   > 12px; } .button:hover, .button:focus { background: #f1f1f1; } .button:focus{
   > background: #f3f5f6; border-color: #007cba; -webkit-box-shadow: 0 0 0 1px #
   > 007cba; box-shadow: 0 0 0 1px #007cba; color: #016087; outline: 2px solid transparent;
   > outline-offset: 0; } .button:active { background: #f3f5f6; border-color: #7e8993;-
   > webkit-box-shadow: none; box-shadow: none; } </style> </head> <body id=”error-
   > page”> <div class=”wp-die-message”><p>There has been a critical error on this
   > website.</p><p><a href=”[https://wordpress.org/support/article/faq-troubleshooting/”>Learn](https://wordpress.org/support/article/faq-troubleshooting/”>Learn)
   > more about troubleshooting WordPress.</a></p></div></body> </html> .`
 * Is this a bug or is something wrong with my configuration?
 * Thanks a lot to all
    -  This topic was modified 4 years, 4 months ago by [Telefunki](https://wordpress.org/support/users/telefunki/).

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-8-x-and-rest-api-error/#post-15308026)
 * WordPress 5.9 Field Guide indicates not fully compatible with PHP 8.0 or 8.1.
   SEE [https://make.wordpress.org/core/2022/01/10/wordpress-5-9-and-php-8-0-8-1/](https://make.wordpress.org/core/2022/01/10/wordpress-5-9-and-php-8-0-8-1/)
 *  Thread Starter [Telefunki](https://wordpress.org/support/users/telefunki/)
 * (@telefunki)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-8-x-and-rest-api-error/#post-15308146)
 * [@t-p](https://wordpress.org/support/users/t-p/)
 * Thanks a lot for your information. I didn’t know that, so it’s better to operate
   still all sites with PHP 7.4?
 * Thanks a lot

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

The topic ‘PHP 8.x and Rest-API Error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Telefunki](https://wordpress.org/support/users/telefunki/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/php-8-x-and-rest-api-error/#post-15308146)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
