Im trying to upgrade a Magento 2 site from 2.2.2 to the latest 2.3. I've got up to 2.2.5 so far without issues.

When moving from 2.2.5 to 2.2.6 I am getting a fatal error when running php bin/magento setup:di:compile

Fatal error:  Interface 'Laminas\ServiceManager\AbstractFactoryInterface' not found in /var/www/html/setup/src/Zend/Mvc/Controller/LazyControllerAbstractFactory.php

I've added the Zend\\Mvc\\Controller line to the autoload PSR-4 section in the composer.json file as suggested elsewhere on the internet.

Here's the steps I follow to update (from a working 2.2.5):

php bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.6 --no-update
composer update
composer dumpautoload
rm -rf var/cache/* var/page_cache/* generated/code/*
php bin/magento setup:upgrade
composer dumpautoload
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento maintenance:disable

Its at the php bin/magento setup:di:compile step where I get the fatal error.

AFAICT the Laminas ServiceManager AbstractFactoryInterface isn't anywhere in the Vendor dir.

Can anyone shed any light on this?

  • there is no reason why you cannot upgrade directly from 2.2.5 to 2.3.x. If you are using REDIS make sure you also flush the redis caches before running setup:upgrade / compile
    – paj
    Dec 3 '20 at 9:43
  • @paj I tried that first but got problems with Could not create an acl object:. Figured an incremental update might help. Dec 3 '20 at 10:36

It seems this was caused by not following an incremental update path from 2.2.2. Initially I tried to go to 2.3.x and added the Zend\\Mvc\\Controller line to composer.json. I then left this line in the composer file when starting the migration from 2.2.5 to 2.2.6.

Removing the line, removing vendor/ and composer.lock and starting the migration again worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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