Lamina-tools is not supporting laminas-servicemanger:3.21

the laminas-tools dependencies are not supporting the laminas-servicemanager:3.21.
pleas suggest me any solution on it the version compatibility error.

Hey @mahendra ,

I can not reproduce your issue. The package laminas-api-tools/api-tools in its latest version 1.7.0 requires the package laminas/laminas-servicemanager with version constraint ^3.11. This means, that the service manager can be updated in the range beginning from 3.11 and must be smaller than 4. Actually you should be able to update the service manager to version 3.21.

What you could do: Edit the composer.json of your application.

"require" : {
    ...
    "laminas/laminas-servicemanager": "^3.2",
   ....
}

Save your composer.json file and then run composer with composer update. If that results into errors because some packages require an older version or whatever, try to add --width-all-dependencies or --ignore-platform-reqs. The given version constraint ^3.2 will update to the lates version 3.22.1 of laminas/laminas-servicemanager.

Actually it is not possible to update to version 4.0 with laminas api tools.

Are there any error messages when you run a composer command?

1 Like

Hi ,

the laminas-servicemanager -^3.22 is compatible with laminas-mvc:4.0.x-dev but after that i am trying to installed below packages are not supporting for php 8.2
after upgrading laminas-mvc 3.7 to laminas-mvc 4.0.x-dev I am getting following errors.

Problem 1

- Root composer.json requires laminas/laminas-mvc 4.0.x-dev, found laminas/laminas-mvc[4.0.x-dev] but these were not loaded, likely because it conflicts with another require.

Problem 2

- laminas-api-tools/api-tools-documentation is locked to version 1.6.0 and an update of this package was not requested.

- laminas-api-tools/api-tools-documentation 1.6.0 requires laminas/laminas-mvc ^3.3 → found laminas/laminas-mvc[3.3.0, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

Problem 3

- laminas-api-tools/api-tools is locked to version 1.7.0 and an update of this package was not requested.

- laminas-api-tools/api-tools 1.7.0 requires laminas/laminas-mvc ^2.7.9 || ^3.0.2 → found laminas/laminas-mvc[2.7.9, …, 2.7.15, 3.0.2, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

Problem 4

- laminas-api-tools/api-tools-admin is locked to version 2.1.1 and an update of this package was not requested.

- laminas-api-tools/api-tools-admin 2.1.1 requires laminas/laminas-mvc ^2.7.15 || ^3.1.1 → found laminas/laminas-mvc[2.7.15, 3.1.1, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

Problem 5

- lm-commons/lmc-user is locked to version v3.6.0 and an update of this package was not requested.

- lm-commons/lmc-user v3.6.0 requires laminas/laminas-mvc ^3.0 → found laminas/laminas-mvc[3.0.0, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

if I trying to install laminas-mvc version ^3.7 then laminas-servicemanager ^3.22 is not compatible with it. with laminas-mvc 3.7 above all dependencies are working but laminas-servicemanager 3.22 is giving me error(due to laminas-mvc 3.7 not compatible with laminas-servicemanager 3.22)
please provide any solution

Can I ask you a question? Why do you want to use exactly this version of laminas/laminas-mvc? Obviously a whole bunch of packages are incompatible. It makes absolutely no sense, to use -dev versions. The current stable version of laminas/laminas-mvc is 3.7.

You can open an issue on GitHub for the relevant packages to change the supported PHP version or just use the --ignore-platform-reqs flag for the composer update command.

The package laminas\laminas-mvc with its current version 3.7 requires laminas/laminas-servicemanager with a version constraint ^3.20.0. The service manager version 3.21 is fully compatible since ^3.20.0 means everything between 3.20.0 and < 4.0.

vendor/laminas/laminas-mvc/src/Service/AbstractPluginManagerFactory.php
public function __invoke(ContainerInterface $container, $name, array $options = null)
{
$options = $options ?: ;
$pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
return new $pluginManagerClass($container, $options);
}

not compatible with

vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php

composer.json

“require”: {
“laminas/laminas-mvc”: “^3.7”,
“laminas/laminas-servicemanager”: “^3.22”
}

in this json file need to upgrade laminas-mvc 4.0
then laminas-mvc 4.0 compatible with laminas-servicemanger:3.22

but other dependencies are confliting

Problem 1

- Root composer.json requires laminas/laminas-mvc 4.0.x-dev, found laminas/laminas-mvc[4.0.x-dev] but these were not loaded, likely because it conflicts with another require.

Problem 2

- laminas-api-tools/api-tools-documentation is locked to version 1.6.0 and an update of this package was not requested.

- laminas-api-tools/api-tools-documentation 1.6.0 requires laminas/laminas-mvc ^3.3 → found laminas/laminas-mvc[3.3.0, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

Problem 3

- laminas-api-tools/api-tools is locked to version 1.7.0 and an update of this package was not requested.

- laminas-api-tools/api-tools 1.7.0 requires laminas/laminas-mvc ^2.7.9 || ^3.0.2 → found laminas/laminas-mvc[2.7.9, …, 2.7.15, 3.0.2, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

Problem 4

- laminas-api-tools/api-tools-admin is locked to version 2.1.1 and an update of this package was not requested.

- laminas-api-tools/api-tools-admin 2.1.1 requires laminas/laminas-mvc ^2.7.15 || ^3.1.1 → found laminas/laminas-mvc[2.7.15, 3.1.1, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

Problem 5

- lm-commons/lmc-user is locked to version v3.6.0 and an update of this package was not requested.

- lm-commons/lmc-user v3.6.0 requires laminas/laminas-mvc ^3.0 → found laminas/laminas-mvc[3.0.0, …, 3.8.x-dev] but it conflicts with your root composer.json require (4.0.x-dev).

please look into this.

Just do not use major version changes, which are currently in development. Use the last stable version 3.7 of laminas mvc, which is fully compatible with 3.21 of laminas service manager.

use Interop\Container\ContainerInterface; in laminas-mvc 3.7 ( vendor/laminas/laminas-mvc/src/Service/AbstractPluginManagerFactory.php)
and

use Psr\Container\ContainerInterface; in laminas-servicemanager 3.21 (vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php)

in this file vendor/laminas/laminas-mvc/src/Service/AbstractPluginManagerFactory.php
i am getting error on line no 24

public function __invoke(ContainerInterface $container, $name, array $options = null)
{
$options = $options ?: ;
$pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
return new $pluginManagerClass($container, $options);
}

any solution?

Is that an error or a warning? I can say that from my past experience, it will be a warning. Please confirm. Thanks!

HI,

I am using php version “php”: “~8.1.0 || ~8.2.0 || ~8.3.0”, in composer.json file.

I am getting the bellow message when intalling lamina-mvc 3.7 and laminas-servicemanager 3.21


Deprecated : Laminas\ServiceManager\AbstractPluginManager::__construct now expects a Psr\Container\ContainerInterface instance representing the parent container; please update your code in /unity/unity_applications/unity/vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php on line 94

Deprecated : Laminas\ServiceManager\AbstractPluginManager::__construct now expects a Psr\Container\ContainerInterface instance representing the parent container; please update your code in /unity/unity_applications/unity/vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php on line 94

Deprecated : Laminas\ServiceManager\AbstractPluginManager::__construct now expects a Psr\Container\ContainerInterface instance representing the parent container; please update your code in /unity/unity_applications/unity/vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php on line 94

Deprecated : Usage of Laminas\ServiceManager\AbstractPluginManager::setServiceLocator is deprecated since v3.0.0; please pass the container to the constructor instead in /unity/unity_applications/unity/vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php on line 214

in laminas-mvc 3.7
use Interop\Container\ContainerInterface
in laminas-servicemanager3.21
use Psr\Container\ContainerInterface
both namaspaces are not compatible that’s why I am getting error in __invoke function which is defined in this file
vendor/laminas/laminas-mvc/src/Service/AbstractPluginManagerFactory.php

and if i use Psr\Container\ContainerInterface namespace instead of Interop\Container\ContainerInterface it is resolved.

public function __invoke(ContainerInterface $container, $name, array $options = null)
{
$options = $options ?: ;
$pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
return new $pluginManagerClass($container, $options);
}

plz provide any solution.

This is an interesting question. Well you can set something like the below in the public/index.php or in bin/container.php

ini_set('display_errors', 0);
// OR
error_reporting(~E_DEPRECATED);
// The choice is yours.  

This is PHP 101 by the way. :smirk:

Your second question about composer.json configuration tells you that you can use the PHP version from 8.1.x to 8.3.x. If I’m correct, if you use the below composer.json file with a future version of PHP 8.4 it will give you an error. This means that your php version is somewhere between 8.1.x to 8.3.x which satisfies the requirement.
Thanks!

It should use Psr\Container\ContainerInterface

Replace the Interopt usage with the Psr usage. The change should be completely transparent to the application.

Do not change any code in the vendor directory!

@ALTAMASH80 has already mentioned the correct procedure: error_reporting

1 Like

Who said anything about changing /vendor code?

The problem is in vendor/laminas/laminas-mvc/src/Service/AbstractPluginManagerFactory.php:

And you wrote:

Sorry for the misunderstanding. I was just referring to their own code when they need to reference Psr containerInterface.

1 Like