By wagafo on
I have a site which is on Drupal 9 on a server which has php 7.3.29. In the Status report it says that php 7.4.0 is recommended, but not required. But since a recent update, I have the following in vendor/composer/platform.check.php:
if (!(PHP_VERSION_ID >= 70400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
}
So I have to comment out this line otherwise my site only shows this message. Is this something that my composer configuration introduced, or is now php 7.4.0 a requirement for Drupal 9?
Comments
PHP 7.4 only D9 recommendation in documentation ...
On PHP requirements it does say that PHP 7.4 is recommended for Drupal 9, which is not the same a required, which that code does imply ... Perhaps you can ask in Discuss PHP requirements to hear those knowledgeable about the details?
Nothing to do with Drupal
It has to do with your project. It is the autoload of composer that checks for minimum PHP requirement for your project.
So, it depends on the requirements of all dependencies. Use `composer depends php` to see what they are.
Suggest to investigate how real the minimum requirement is.
Checked composer php requirements
I did "composer depends php", and the only thing that requires php >= 7.3 is
laminas/laminas-servicemanager 3.10.0 requires php (~7.4.0 || ~8.0.0 || ~8.1.0)I don't know where this comes from, I'm just using composer to manage Drupal and don't install anything apart from Drupal dependencies, so in my opinion this has to do with Drupal somehow.
What is this "laminas" package anyway?
Same command
My situation:
laminas/laminas-servicemanager 3.7.0 requires php (^7.3 || ~8.0.0)
This is what I get
This is what I get, can it be figured out from here why my project is requiring php 7.4?
> composer depends laminas/laminas-servicemanagerlaminas/laminas-feed 2.14.1 conflicts laminas/laminas-servicemanager (<3.3)
laminas/laminas-text 2.8.1 requires laminas/laminas-servicemanager (^3.4)
And:
> composer depends laminas/laminas-servicemanager -tlaminas/laminas-servicemanager 3.10.0 Factory-Driven Dependency Injection Container
├──laminas/laminas-feed 2.14.1 (conflicts laminas/laminas-servicemanager <3.3) (circular dependency aborted here)
└──laminas/laminas-text 2.8.1 (requires laminas/laminas-servicemanager ^3.4)
├──laminas/laminas-text 2.8.1 (replaces zendframework/zend-text ^2.7.1)
│ └──laminas/laminas-text 2.8.1 (replaces zendframework/zend-text ^2.7.1) (circular dependency aborted here)
├──laminas/laminas-text 2.8.1 (replaces zendframework/zend-text ^2.7.1) (circular dependency aborted here)
└──mathieuviossat/arraytotexttable v1.0.8 (requires laminas/laminas-text ^2.7)
└──drupal/upgrade_status 3.11.0 (requires mathieuviossat/arraytotexttable ~1.0.0)
└──drupal/recommended-project dev-master (requires drupal/upgrade_status ^3.4)
Yes, it can
It shows you can have anything from 3.4 and higher. Looking at the different versions you can see 3.8 is the last one still allowing php 7.3.
So, add "<3.8" to your version constraint and update
Or maybe even better add "<7.4" to your php version constraint.
I solved this by downgrading
I solved this by downgrading laminas/laminas-servicemanager. I preferred this to constraining php to <7.4, because the latter will not allow me to mirror my site in systems with php >= 7.4, which I need to develop and test things.
To downgrade the above, I added the following line to the require{} section in composer.json:
"laminas/laminas-servicemanager": "<3.8"So far everything seems to work fine. The downgraded package is a dependence of the Drupal upgrade-status module version 3.10.