Problem/Motivation

I am unable to install drupal 9 on php 8.2 I installed 8.2 since it is coming out in a couple weeks and the default ubuntu 8.1 version has issues.

I found a related META issue that was closed, but wasn't sure if I should reopen it.

Steps to reproduce

Install php 8.2
Install php 8.2 dependencies
Try installing drupal 9

I get hundreds of errors like:

Deprecated function: Creation of dynamic property Drupal\Core\Installer\InstallerKernel::$_serviceId is deprecated in Drupal\Core\DependencyInjection\ContainerBuilder->set() (line 83 of /var/www/site.com/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php).

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

nicxvan created an issue. See original summary.

nicxvan’s picture

Display errors is off on the server, I saw a reference to that in the related comment but it didn't help.

nicxvan’s picture

Even with the deprecations I can proceed through most of the install wizard, but once I get to the actual install it hard fails with the error posted.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

That is a deprecation introduced in PHP 8.2 but it isn’t an error. Drupal 9.5 and 10, I think, are the intended compatibility targets. So I would start by testing the 9.5 and 10.0 dev releases and also validate that contributed modules, if any, are updated for PHP 8.2.

cilefen’s picture

Status: Postponed (maintainer needs more info) » Active

I am not certain about those assertions so I’ll leave this at active.

nicxvan’s picture

Title: Unable to install Drupal 9.4.8 on php 8.2 » Multiple deprecation notices on installing Drupal 9.5 on php 8.2 and mysql 8
Version: 9.4.x-dev » 9.5.x-dev

Oh thanks! This is a new site so I was able to bump it to 9.5

After doing that I was able to run through the install process. I still got a bunch of deprecation notices:

Deprecated function: Use of "static" in callables is deprecated in Drupal\user\Entity\Role::postLoad() (line 172 of core/modules/user/src/Entity/Role.php).

Drupal\user\Entity\Role::postLoad(Object, Array) (Line: 423)

A note I'm also on Mysql 8

I'm going to update the title to point to 9.5 and more accurately reflect the issue.

cilefen’s picture

berdir’s picture

No, that's not that issue. Imho, d9 will not be compatible with php 8.2

andypost’s picture

It's too much work to make it compatible but someone could be willing to maintain compatibility as patch

cilefen’s picture

#8 is the key point. We can close this as "works as designed".

@Berdir: #3274474: Fix 'Access to an undefined property' PHPStan L0 errors uncovered this specific Roles.php thing with PHPStan. That's the reason I cited it.

berdir’s picture

The static callable problem was fixed for D10 in #3299327: Replace deprecated static::method() calls for PHP 8.2, not #3274474: Fix 'Access to an undefined property' PHPStan L0 errors.

Sorry for the short comment, that was from phone. It's less about the amount of work that we have to do and more about backwards compatibility impact of new properties, our dependencies might also not be compatible on D9 and so on.

But yes. if you want to use the shiny new PHP version, use the shiny new Drupal version. It will be out at the same time as Drupal 9.5 and many contrib modules are already compatible, if you start a new project there's a good chance that most you need are ready and the few that aren't can be dealt with in the the composer lenient plugin + patches.

cilefen’s picture

Status: Active » Closed (works as designed)
nicxvan’s picture

Thanks everyone! I was not aware that Drupal 9 was not going to support PHP 8.2
I will look look into updating to Drupal 10!

Thanks for reviewing

chi’s picture

I was not aware that Drupal 9 was not going to support PHP 8.2

That's because Drupal 9 states support for PHP 8.2 in composer.json.

"php": ">=7.3.0",

I think it needs to be update to avoid confusion.

ressa’s picture

Yes @nicxvan, it can get complicated :-) To stay up to date, I regularly check the PHP requirements page. A great resource, with very frequent updates.

oknaru’s picture

I am also getting many such errors with migration_plus, wordpress_migrate using PHP8.1.3 on wamp.