
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).
Comments
Comment #2
nicxvan CreditAttribution: nicxvan commentedDisplay errors is off on the server, I saw a reference to that in the related comment but it didn't help.
Comment #3
nicxvan CreditAttribution: nicxvan commentedEven 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.
Comment #4
cilefen CreditAttribution: cilefen commentedThat 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.
Comment #5
cilefen CreditAttribution: cilefen commentedI am not certain about those assertions so I’ll leave this at active.
Comment #6
nicxvan CreditAttribution: nicxvan commentedOh 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.
Comment #7
cilefen CreditAttribution: cilefen commentedThat particular one is mentioned in #3274474: Fix 'Access to an undefined property' PHPStan L0 errors.
Comment #8
berdirNo, that's not that issue. Imho, d9 will not be compatible with php 8.2
Comment #9
andypostIt's too much work to make it compatible but someone could be willing to maintain compatibility as patch
Comment #10
cilefen CreditAttribution: cilefen commented#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.
Comment #11
berdirThe 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.
Comment #12
cilefen CreditAttribution: cilefen commentedComment #13
nicxvan CreditAttribution: nicxvan commentedThanks 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
Comment #14
chi CreditAttribution: chi commentedThat's because Drupal 9 states support for PHP 8.2 in composer.json.
I think it needs to be update to avoid confusion.
Comment #15
ressa CreditAttribution: ressa at Ardea commentedYes @nicxvan, it can get complicated :-) To stay up to date, I regularly check the PHP requirements page. A great resource, with very frequent updates.
Comment #16
oknaru CreditAttribution: oknaru commentedI am also getting many such errors with migration_plus, wordpress_migrate using PHP8.1.3 on wamp.