Magento 2.3 – Fix PHP Fatal Error in InitParamListener

magento-upgrademagento2magento2.3

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.

Best Answer

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

Related Topic