After running composer require laminas/laminas-ldap
I get the following message
Cannot use laminas/laminas-ldap's latest version 2.17.0 as it requires php ~8.0.0 || ~8.1.0 || ~8.2.0 which is not satisfied by your platform. ...
php -i | grep "PHP Version"
shows PHP Version => 8.0.23
Do I need another php version (sorry in the case that the question is stupid, I am not used to work with composer)?
Hello and welcome to our forums!
Composer usually tells something more, such as the following:
Problem 1
- Root composer.json requires laminas/laminas-ldap ^2.17.0
-> satisfiable by laminas/laminas-ldap[2.17.0].
- laminas/laminas-ldap 2.17.0 requires php ~8.0.0 || ~8.1.0 || ~8.2.0
-> your php version (7.4.33) does not satisfy that requirement.
What is the exact message you received?
Thanks for your quick reply. Here is the complete output:
# composer require laminas/laminas-ldap --optimize-autoloader
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? y
Info from https://repo.packagist.org: #StandWithUkraine
Cannot use laminas/laminas-ldap's latest version 2.17.0 as it requires php ~8.0.0 || ~8.1.0 || ~8.2.0 which is not satisfied by your
platform.
./composer.json has been updated
Running composer update laminas/laminas-ldap
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking laminas/laminas-ldap (2.13.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 47 installs, 0 updates, 0 removals
- Installing composer/pcre (1.0.1): Extracting archive
Unzipping using 7z 16.02 may result in incorrect file permissions. Install 7z 21.01+ or unzip to ensure you get correct permissio
ns.
- Installing dama/doctrine-test-bundle (v6.7.5): Extracting archive
- Installing doctrine/data-fixtures (1.6.3): Extracting archive
- Installing doctrine/doctrine-fixtures-bundle (3.4.2): Extracting archive
- Installing fakerphp/faker (v1.20.0): Extracting archive
- Installing symfony/process (v4.4.44): Extracting archive
- Installing php-cs-fixer/diff (v2.0.2): Extracting archive
- Installing composer/xdebug-handler (2.0.5): Extracting archive
- Installing composer/semver (3.3.2): Extracting archive
- Installing friendsofphp/php-cs-fixer (v3.4.0): Extracting archive
- Installing laminas/laminas-ldap (2.13.0): Extracting archive
- Installing phpstan/phpstan (1.9.18): Extracting archive
- Installing phpstan/phpstan-doctrine (1.3.32): Extracting archive
- Installing phpstan/phpstan-phpunit (1.3.4): Extracting archive
- Installing phpstan/phpstan-symfony (1.2.18): Extracting archive
- Installing sebastian/version (3.0.2): Extracting archive
- Installing sebastian/type (3.2.1): Extracting archive
- Installing sebastian/resource-operations (3.0.3): Extracting archive
- Installing sebastian/recursion-context (4.0.5): Extracting archive
- Installing sebastian/object-reflector (2.0.4): Extracting archive
- Installing sebastian/object-enumerator (4.0.4): Extracting archive
- Installing sebastian/global-state (5.0.5): Extracting archive
- Installing sebastian/exporter (4.0.5): Extracting archive
- Installing sebastian/environment (5.1.5): Extracting archive
- Installing sebastian/diff (4.0.4): Extracting archive
- Installing sebastian/comparator (4.0.8): Extracting archive
- Installing sebastian/code-unit (1.0.8): Extracting archive
- Installing sebastian/cli-parser (1.0.1): Extracting archive
- Installing phpunit/php-timer (5.0.3): Extracting archive
- Installing phpunit/php-text-template (2.0.4): Extracting archive
- Installing phpunit/php-invoker (3.1.1): Extracting archive
- Installing phpunit/php-file-iterator (3.0.6): Extracting archive
- Installing theseer/tokenizer (1.2.1): Extracting archive
- Installing nikic/php-parser (v4.15.3): Extracting archive
- Installing sebastian/lines-of-code (1.0.3): Extracting archive
- Installing sebastian/complexity (2.0.2): Extracting archive
- Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
- Installing phpunit/php-code-coverage (9.2.24): Extracting archive
- Installing phar-io/version (3.2.1): Extracting archive
- Installing phar-io/manifest (2.0.3): Extracting archive
- Installing phpunit/phpunit (9.5.28): Extracting archive
- Installing symfony/dom-crawler (v4.4.4): Extracting archive
- Installing symfony/browser-kit (v4.4.44): Extracting archive
- Installing symfony/debug-bundle (v4.4.37): Extracting archive
- Installing symfony/maker-bundle (v1.39.1): Extracting archive
- Installing symfony/phpunit-bridge (v4.4.49): Extracting archive
- Installing symfony/web-profiler-bundle (v4.4.47): Extracting archive
Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package symfony/inflector is abandoned, you should avoid using it. Use EnglishInflector from the String component instead.
Package php-cs-fixer/diff is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
140 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Run composer recipes at any time to see the status of your Symfony recipes.
Executing script cache:clear [OK]
Executing script assets:install [OK]
No security vulnerability advisories found
Using version ^2.13 for laminas/laminas-ldap
It looks like you are running PHP with version 7.3 because older versions of the packages are installed:
- the version of PHPUnit is old:
>=7.3
- the version of Faker is old:
^7.1 || ^8.0
- the version of laminas-ldap is old:
^7.3 || ~8.0.0 || ~8.1.0
- …
When you run Composer, it uses the CLI version of PHP, which may be a different version than the web server.
very strange - thought I got rid of php7.3; I created a link to php8.0 under /usr/local/bin with the name php and now it works (thank you for pointing me in the right direction)
Please note that version 8.0 is also outdated.
my problem is that I am using a Synology NAS - so far, Synology does not offer an up-to-date version of php
Hey Becke,
Try a composer why-not laminas/laminas-ldap 2.17.0
for more details.