0

i use Magento 2.4.3 with php7.4 after composer update:

  - Updating laminas/laminas-dependency-plugin (2.4.0 => 2.5.0):  Checking out 8f2d101993
  - Updating laminas/laminas-stdlib (3.13.0 => 3.16.1):  Checking out f4f7736418
  - Updating laminas/laminas-servicemanager (3.17.0 => 3.20.0):  Checking out bc2c2cbe2d
  - Updating laminas/laminas-validator (2.25.0 => 2.29.0):  Checking out e40ee8d86c
  - Updating laminas/laminas-mime (2.10.0 => 2.11.0):  Checking out 60ec04b755
  - Updating laminas/laminas-mail (2.16.0 => 2.21.1):  Checking out 6e3d32a81d
  - Updating laminas/laminas-eventmanager (3.5.0 => 3.9.2):  Checking out 55f7c337f4
  - Updating laminas/laminas-config (3.7.0 => 3.8.0):  Checking out 46baad58d0
  - Updating laminas/laminas-modulemanager (2.12.0 => 2.14.0):  Checking out fb0a2c3442
  - Updating laminas/laminas-serializer (2.13.0 => 2.14.0):  Checking out c4ceeb080f
  - Updating laminas/laminas-text (2.9.0 => 2.10.0):  Checking out 40f7acdb28

I got this error message:

PHP Fatal error:  Cannot use ::class with dynamic class name in ../vendor/laminas/laminas-servicemanager/src/ServiceManager.php on line 984

enter image description here

            while (isset($this->aliases[$tCursor])) {
            $stack[] = $aCursor;
            if ($aCursor === $this->aliases[$tCursor]) {
                throw CyclicAliasException::fromCyclicAlias($alias, $this->aliases);
            }
            $aCursor = $tCursor;
            $tCursor = $this->aliases[$tCursor];
        }

enter image description here

            throw new ServiceNotCreatedException(sprintf(
            'A non-callable delegator, "%s", was provided; expected a callable or instance of "%s"',
            is_object($delegatorFactory) ? $delegatorFactory::class : gettype($delegatorFactory),
            DelegatorFactoryInterface::class
        ));
    }
}

my composer.json

{
  "name": "magento/project-community-edition",
  "description": "eCommerce Platform for Growth (Community Edition)",
  "type": "project",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "php": "^7.3.0||^7.4.0",

    "immerce/email": "*",
    "laminas/laminas-config": "*",
    "laminas/laminas-dependency-plugin": "*",
    "laminas/laminas-eventmanager": "*",
    "laminas/laminas-mail": "*",
    "laminas/laminas-mime": "*",
    "laminas/laminas-modulemanager": "*",
    "laminas/laminas-serializer": "*",
    "laminas/laminas-servicemanager": "*",
    "laminas/laminas-stdlib": "*",
    "laminas/laminas-validator": "*",
    "liquid/liquid": "^1.4.17",
 
    "psr/cache": "2.0.0",
    "psr/simple-cache": "^1.0",
    "sendinblue/module-sendinblue": "*",
    "symfony/polyfill-mbstring": "*",
    "vertex/module-tax": "4.2.*",
    "vertex/product-magento-module": "4.2.1",
    "vertexinc/product-magento-module": "4.2.1",
    "wallee/magento-2": "1.3.14"
  },
  "require-dev": {
    "allure-framework/allure-phpunit": "~1.2.0",
    "friendsofphp/php-cs-fixer": "~2.14.0",
    "lusitanian/oauth": "~0.8.10",
    "magento/magento-coding-standard": "~3.0.0",
    "magento/magento2-functional-testing-framework": "2.4.5",
    "mockery/mockery": "^1.2",
    "pdepend/pdepend": "2.5.2",
    "phpmd/phpmd": "@stable",
    "sebastian/phpcpd": "~3.0.0",
    "squizlabs/php_codesniffer": "~3.4.0"
  },
  "config": {
    "preferred-install": "source",
    "sort-packages": true,
    "use-include-path": true,
    "discard-changes": true,
    "allow-plugins": {
      "laminas/laminas-dependency-plugin": true,
      "magento/magento-composer-installer": true,
      "magento/inventory-composer-installer": true,
      "cweagans/composer-patches": true

What can i do to fix it? Thank for any help. Best regards

After update the composer file:

    staging@***:~/public_html(develop)$ php bin/magento maintenance:enable && php bin/magento setup:upgrade && rm -rf var/view_preprocessed var/cache/ var/page_cache/ var/generation/* && php bin/magento setup:di:compile && php bin/magento setup:static-content:de en_US de_CH fr_CH -f && php bin/magento cache:enable && php bin/magento cache:flush && php bin/magento maintenance:disable

Argument 1 passed to Laminas\Di\Config::ensureArrayOrArrayAccess() must be an instance of Laminas\Di\mixed, array given, called in /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Config.php on line 104#0 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Config.php(104): Laminas\Di\Config->ensureArrayOrArrayAccess()
#1 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/ConfigFactory.php(56): Laminas\Di\Config->__construct()
#2 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/ConfigFactory.php(64): Laminas\Di\Container\ConfigFactory->create()
#3 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(615): Laminas\Di\Container\ConfigFactory->__invoke()
#4 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()
#5 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/InjectorFactory.php(20): Laminas\ServiceManager\ServiceManager->get()
#6 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/InjectorFactory.php(36): Laminas\Di\Container\InjectorFactory->createConfig()
#7 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/InjectorFactory.php(45): Laminas\Di\Container\InjectorFactory->create()
#8 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(615): Laminas\Di\Container\InjectorFactory->__invoke()
#9 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()
#10 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/AutowireFactory.php(24): Laminas\ServiceManager\ServiceManager->get()
#11 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/AutowireFactory.php(48): Laminas\Di\Container\AutowireFactory->getInjector()
#12 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-di/src/Container/ServiceManager/AutowireFactory.php(33): Laminas\Di\Container\AutowireFactory->canCreate()
#13 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(554): Laminas\Di\Container\ServiceManager\AutowireFactory->canCreate()
#14 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(614): Laminas\ServiceManager\ServiceManager->getFactory()
#15 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()
#16 /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-mvc/src/Application.php(147): Laminas\ServiceManager\ServiceManager->get()
#17 /var/www/***/repo/htdocs/magento/src/setup/src/Magento/Setup/Application.php(51): Laminas\Mvc\Application->bootstrap()
#18 /var/www/***/repo/htdocs/magento/src/vendor/magento/framework/Console/Cli.php(80): Magento\Setup\Application->bootstrap()
#19 /var/www/***/repo/htdocs/magento/src/bin/magento(22): Magento\Framework\Console\Cli->__construct()
#20 {main}
3
  • Could you edit your post to add the content of your composer.json file?
    – Tu Van
    Jan 6, 2023 at 12:43
  • i add it - but i removed some entry because of my policy.
    – FloWord
    Jan 6, 2023 at 13:12
  • No worries, it's enough.
    – Tu Van
    Jan 6, 2023 at 13:15

1 Answer 1

0

After composer update, as you can see some new versions of laminas packages have an issue with your site (Magento 2.4.3), you should downgrade these packages by specifically the old laminas versions in composer.json.
To do that, replace the following lines:

    "laminas/laminas-config": "*",
    "laminas/laminas-dependency-plugin": "*",
    "laminas/laminas-eventmanager": "*",
    "laminas/laminas-mail": "*",
    "laminas/laminas-mime": "*",
    "laminas/laminas-modulemanager": "*",
    "laminas/laminas-servicemanager": "*",
    "laminas/laminas-stdlib": "*",
    "laminas/laminas-validator": "*",

with

"laminas/laminas-config": "3.7.0",
"laminas/laminas-dependency-plugin": "2.4.0",
"laminas/laminas-eventmanager": "3.5.0",
"laminas/laminas-mail": "2.16.0",
"laminas/laminas-mime": "2.10.0",
"laminas/laminas-modulemanager": "2.12.0",
"laminas/laminas-servicemanager": "3.17.0",
"laminas/laminas-stdlib": "3.13.0",
"laminas/laminas-validator": "2.25.0",

After that, run the following commands:

composer update
rm -rf generated
bin/magento setup:di:compile

Note
Bear in mind that when you upgrade to a new Magento version (eg 2.4.4 or 2.4.5...), you should remove these lines to allow the upgrade to work.

6
  • Now i got this error: Package operations: 742 installs, 0 updates, 0 removals - Installing laminas/laminas-dependency-plugin (2.5.0): Cloning 8f2d101993 from cache PHP Fatal error: Cannot use ::class with dynamic class name in /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterV1.php on line 106 Fatal error: Cannot use ::class with dynamic class name in /var/www/***/repo/htdocs/magento/src/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterV1.php on line 106
    – FloWord
    Jan 6, 2023 at 14:27
  • @FloWord I've updated the solution in my answer, please give it a try.
    – Tu Van
    Jan 6, 2023 at 14:54
  • composer update was success but now i have this error, see on my post in top
    – FloWord
    Jan 6, 2023 at 15:57
  • 1
    Looks like when you run composer update, it also updated laminas/laminas-di package. Try to add "laminas/laminas-di": "3.2.2", into your require section in composer.json then run composer update and magento upgrade, compile code commands again.
    – Tu Van
    Jan 6, 2023 at 16:21
  • thanks, it works!
    – FloWord
    Jan 6, 2023 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.