# WordPress PHP 8.1 Support: Not Found

**URL:** https://discourse.roots.io/t/wordpress-php-8-1-support-not-found/24508
**Category:** blog
**Created:** 2023-01-04T02:25:12Z
**Posts:** 6

## Post 1 by @QWp6t — 2023-01-04T02:25:12Z

As of 2023-01-03, the latest version of WordPress (6.1.1) [still only has “beta support” for PHP 8.0+](https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/). PHP 8.1 was [released in Nov 2021](https://www.php.net/supported-versions.php). 404 days later, full support for PHP 8.1 is still “not found”.

Read more on the Roots blog:

> **[WordPress PHP 8.1 Support: Not Found](https://roots.io/wordpress-php-8-1-support-not-found/)**
>
> PHP 8.1 was released 404 days ago. As of 2023-01-03, WordPress still only has “beta support” for PHP 8.0+.

---

## Post 2 by @dsturm — 2023-01-13T15:35:26Z

Nice! Didn’t know this :+1:t3:

As someone who likes to stick to the CLI, a shorthand would be:

```
composer require cweagans/composer-patches rmccue/requests:v1.8.1 && composer config --json extra.patches.rmccue/requests '{"Remove PHP 8.1 deprecation notices": "https://patch-diff.githubusercontent.com/raw/WordPress/Requests/pull/505.diff"}'
```

---

## Post 3 by @Davide_Prevosto — 2023-02-10T07:56:47Z

There was an important update here, please read at: [Patching WordPress Requests for PHP 8.1 | Alexander Goller](https://www.alexandergoller.com/journal/13993/patching-wordpress-requests-for-php-8-1/)

Unfortunately at this time I am getting:

`Could not apply patch! Skipping. The error was: The process "patch '-p1' --no-backup-if-mismatch -d '/Users/encodia/Sviluppo/www/XYZ/landing.example.it/vendor/rmccue/requests' < '/var/folders/nf/rxrcj1fd74j06wlg3pbvc5600000gn/T/63e5f361afe0a.patch'" exceeded the timeout of 300 seconds.`

Still investigating.

---

## Post 4 by @Davide_Prevosto — 2023-02-10T13:43:27Z

For those interested: I was able to fix the error using (on my iMac): `brew install gpatch`

Anyway I am now getting the following errors, so I decided to switch again to PHP 8.0  
Could not apply patch! Skipping. The error was: Cannot apply patch [https://patch-diff.githubusercontent.com/raw/WordPress/Requests/pull/681.diff](https://patch-diff.githubusercontent.com/raw/WordPress/Requests/pull/681.diff)

WordPress fighting.

---

## Post 5 by @talss89 — 2023-02-10T14:43:06Z

I just wanted to add, an alternative approach is to `no-op` the deprecated trigger filters as [suggested in `wp-cli#5623`](https://github.com/wp-cli/wp-cli/issues/5623#issuecomment-1408979243).

We’re using this as a `mu-plugin`:

```
<?php
/**
 * Plugin Name: Disable Deprecation Notices
 * Description: Disable WordPress PHP 8.1+ deprecation notices in non-production environments
 * Version: 1.0.0
 * License: MIT License
 */

if(env('WP_ENV') !== 'production' && !isset($_REQUEST['_WP_DEPRECATED'])) {
    add_filter( 'deprecated_constructor_trigger_error', '__return_false' );
    add_filter( 'deprecated_function_trigger_error', '__return_false' );
    add_filter( 'deprecated_file_trigger_error', '__return_false' );
    add_filter( 'deprecated_argument_trigger_error', '__return_false' );
    add_filter( 'deprecated_hook_trigger_error', '__return_false' );
}
```

You can bypass suppression by setting the URL parameter `_WP_DEPRECATED`

I might be wrong, but this feels cleaner to me than patching core on deploy or suppressing `E_DEPRECATED`.

---

## Post 6 by @folbert — 2023-03-08T16:03:07Z

[Requests library upgraded to 2.0.5 in WordPress 6.2 – Make WordPress Core](https://wp.me/p2AvED-qVt) :tada:
