Hello friends!
I am currently trying to install dependencies for my project using Composer. However, I am encountering a persistent difficulty, as indicated by the following error message: "Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0"".
It is important to note that my PHP version is currently at 8.1.7, which should, in principle, satisfy the stated requirements. Nevertheless, the error message persists.
I am wondering about the nature of this issue. Is this incompatibility specifically related to the OSSN project, or is it an independent matter unrelated to the project itself? My PHP version is higher than the minimum required version, raising questions about the origin of this incompatibility.
I am seeking advice or additional information to resolve this situation. Any assistance would be greatly appreciated.
Thank you for your understanding and potential help!
I think you are stand up for informing us and adding so much information here so someone like myself who is not very skilled can learn and hopefully help someone else with this down the road.
Thank you.
The problem is resolved.
In my case, the PHP_VERSION_ID
constant returns 70133, indicating version 7.1.33, while the php -v command indicates version 8.1.7.
This suggests an inconsistency between the PHP version used by the web server and the one used in the command line. To have version 8.1.7 in my PHP scripts, I had to ensure that the PHP module used in my web server is configured to use this version. I made sure that the PHP module for Apache is configured to use version 8.1.
Here are the commands I executed:
sudo a2dismod php7.1
sudo a2enmod php8.1
sudo systemctl restart apache2
For any useful purpose, here is the code of the file platform_check.php
that produces this error:
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 80100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}
Yes php -v
gives:
PHP 8.1.7 (cli) (built: Jun 25 2022 08:12:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.7, Copyright (c) Zend Technologies
with Zend OPcache v8.1.7, Copyright (c), by Zend Technologies
And sudo update-alternatives --config php
gives:
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/php8.1 81 auto mode
1 /usr/bin/php7.1 71 manual mode
2 /usr/bin/php7.2 72 manual mode
3 /usr/bin/php8.1 81 manual mode
Well, since it's not the first time that people here are not aware of the difference between the PHP command-line version and the PHP webserver version, please allow the question:
Does php -v
really gives 8.1.7 on your command-line?
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)