I am upgrading Magento 2.3.3 to Magento ver 2.3.5-p1 through the composer. After composer install and composer update when I try to run bin/magento setup: upgrade I am getting

"An abstract factory could not create an instance of magentoframeworkappdeploymentconfig(alias: Magento\Framework\App\DeploymentConfig)."

error. Please suggest on this. PHP ver 7.3.18

  • I'm experimenting exactly the same issue, no luck with the Mohit's suggestion. I will keep investigating and waiting to see if somebody else suggests a different solution. Commented Jun 4, 2020 at 17:31
  • @ManuelGarcíaSolipa did you got any solution for this?
    – Piyush
    Commented Jun 10, 2020 at 9:35
  • If you see this error in isolation without any other warnings then it is strange but you should follow the guidance below. But after reinstalling my vendor folder I realised a further warning told me about a malformed module.xml in app/code. Make sure you check ALL WARNINGS Commented May 21, 2021 at 7:47

9 Answers 9


"Unable to run bin/magento In some cases after running the composer upgrade you may find yourself unable to run bin/magento on the command line, and instead get the following error

An abstract factory could not create an instance of magentoframeworkappdeploymentconfig(alias: Magento\Framework\App\DeploymentConfig).

This is due to the setup folder not being updated, which means it still has references to the Zend Framework packages rather than the new Laminas ones.

The way to fix this is to use composer to create a new Magento 2 project and then copy the setup folder from there in to the code base. Make sure any changes that you have made to the directory are applied and then the command should work"


In my case I just copied the setup folder of another working magento installation over mine. I also noticed that all modules were disabled. So I had to enable them

php bin/magento module:enable --all && php bin/magento setup:upgrade && php bin/magento setup:di:compile && php bin/magento setup:static-content:deploy de_DE && php bin/magento setup:static-content:deploy
  • 1
    this has saved my day @Black. Thank you so much. I just taken a setup folder from working project and then eveything is working. Commented Aug 14, 2021 at 17:00

You can see this error if you run bin/magento with an incompatible PHP version for the Magento platform you are running

Find your current magento version in the footer of the admin panel (or if it is working bin/magento --version) and check system requirements

Then run bin/magento with the correct php executable:

/usr/bin/php7.2 bin/magento

Note: For Linux systems a more permanent solution to this is to run sudo update-alternatives --config php and select the correct PHP version for Magento (if installed) and switch to it


clear vendor folder rm -rf vendor/*

then run composer install and bin/magento setup:upgrade has worked today for me

  • thanks that save my time
    – Asad Ullah
    Commented Jun 13, 2021 at 7:53

This is due to some dependencies wrongly installed in the system. Either remove vendor folder and go again with composer update/ install. Or an easy workaround is add following in composer.json

"conflict": {
        "laminas/laminas-mvc": "*"

Vendor Reset Required, from Magento root, run:-


php -d memory_limit=-1 ./bin/magento maintenance:enable

rm -rf vendor

rm -rf var/page_cache/* var/di/* var/view_process/* var/cache/* var/generation/*

rm -rf pub/static/adminhtml pub/static/deployed_version.txt pub/static/_requirejs pub/static/frontend

composer update --no-dev

php -d memory_limit=-1 ./bin/magento setup:upgrade

php -d memory_limit=-1 ./bin/magento setup:di:compile

php -d memory_limit=-1 ./bin/magento indexer:reindex

php -d memory_limit=-1 ./bin/magento setup:static-content:deploy -f en_GB en_US

php -d memory_limit=-1 ./bin/magento cache:clean

php -d memory_limit=-1 ./bin/magento cache:flush

php -d memory_limit=-1 ./bin/magento maintenance:disable

I solved it like this.


rm -rf generated var/cache/* var/view_preprocessed pub/static/*

Open your site in the browser! (important, so that code is getting generated). I got:

Please update your modules: Run "composer install" from the Magento root directory.


composer install


php bin/magento setup:upgrade

I have faced the same issue. After cleaning every thing: cache, generated, var/view_preprocessed, etc.

I tried to use PHP CLI debug, I found that it's a PHP version issue.


Another solution could be to just run php bin/magento setup:upgrade in one case I was able to solve it like this.

It can also be caused if you are using an invalid PHP CLI version. For instance we got this problem after changing to PHP 8 on CLI.


You should run this command:

rm -rf generated var/cache/* var/view_preprocessed pub/static/*
composer install
chmod -R 777 var pub generated
php bin/magento setup:upgrade 
php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f 
php bin/magento cache:flush
  • 1
    chmod -R 777 is the laziest, least secure way of doing this. So please don't. A better way is to chown instead. Commented Nov 2, 2020 at 10:37

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.