1

I have updated the version of magento from 2.3.4 => 2.3.7 but. Composer commands runs successfully with no error. But now when I try to run magento commands eg. s:up or compile it does not work and returns an error :

PHP Fatal error: Class Magento\Setup\Mvc\Bootstrap\InitParamListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Laminas\ServiceManager\Factory\FactoryInterface::__invoke) in /htdocs/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php on line 32

I tried composer update , composer install , removed vendor folder and then composer install but no luck.

Please help me to solve the issue I will be very thankful to you.

2

To fix this issue, copy the setup folder from magento 2.3.7 another project or download it from magento git repo: https://github.com/magento/magento2/tree/2.3.7/setup

It works for all others magento versions, just change 2.3.7 to your magento upgrade version. For example, you want to upgrade to magento 2.4.3, the setup folder can get in https://github.com/magento/magento2/tree/2.4.3/setup

3
  • do I just only need to replace the setup folder? Sep 6 '21 at 19:00
  • how it will work? I have updated the version it is not a fresh installation I think. Please share your thoughts Sep 6 '21 at 19:01
  • 1. Download or copy setup folder from magento core 2. Run this command to remove the current setup folder: rm -rf setup 3. Go to the project root folder, run this command to copy the new setup folder to the project root folder: cp -r PATH_TO/SETUP_FOLDER_JUST_DOWNLOADED . Done.
    – Tu Van
    Sep 7 '21 at 8:37
0

In that case, you'll need to figure out why exactly that file isn't being updated, what you could try is removing your entire vendor directory and run composer install, and after that check if the bin/magento file is now updated. If that still doesn't resolve it, check if the file vendor/magento/magento2-base/bin/magento is correct. If this one is correct and bin/magento is not correct, then you have a problem where that first file isn't being copied to the second file, which should normally happen during composer install.

1
  • Yes, I already followed the composer install , but no luck. how can I confirm if the file is correct and is it possible if I will copy the suggested files from another instance of magento? Aug 30 '21 at 12:05

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.