5

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

3
  • 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. Jun 4 '20 at 17:31
  • @ManuelGarcíaSolipa did you got any solution for this?
    – Piyush
    Jun 10 '20 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 May 21 at 7:47
5

"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"

Source


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
  • 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. Aug 14 at 17:00
4

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

4

clear vendor folder rm -rf vendor/*

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

1
  • thanks that save my time
    – Asad Ullah
    Jun 13 at 7:53
1

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": "*"
    }
1

Vendor Reset Required, from Magento root, run:-

# VENDOR REMOVAL RESET

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
0

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. Nov 2 '20 at 10:37
0

I solved it like this.

Run:

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.

Run:

composer install

Run:

php bin/magento setup:upgrade
0

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.

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.