# Upgrading laminas version 3 from laminas version 2

**URL:** <https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937>\
**Category:** Migration\
**Created:** [June 28, 2022, 9:32am UTC](https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937 "2022-06-28T09:32:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilamrsharma](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nilamrsharma/32/1323_2.png) [@nilamrsharma](https://discourse.laminas.dev/u/nilamrsharma)\
**Post date:** [June 28, 2022, 9:32am UTC](https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937/1 "2022-06-28T09:32:42Z")

</div>

Our current project is on Laminas2. Last year we had updated our project from ZF2 to Laminas2.  
Now we want to upgrade to laminas3(php 8.1) and we have started the migration but it is not going as smooth as expected.  
We are facing lots of issues. Did we took any wrong step? We are following the migration documents.

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [June 28, 2022, 9:39am UTC](https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937/2 "2022-06-28T09:39:25Z")

</div>

Hello and welcome to our forums! 😃

> [@nilamrsharma](#):
>
> We are facing lots of issues.

Which issues? Please provide error message and/or stack traces.

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [June 28, 2022, 9:49am UTC](https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937/3 "2022-06-28T09:49:03Z")

</div>

You will need to be much more specific than that 🙂

Software is complex and breaks in different ways depending on how it was built: what are you experiencing, exactly?

Have you written automation tests? Static analysis? What guides were you following, precisely?

---

<div class="post-metadata">

**Author:** ![nilamrsharma](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nilamrsharma/32/1323_2.png) [@nilamrsharma](https://discourse.laminas.dev/u/nilamrsharma)\
**Post date:** [June 28, 2022, 10:53am UTC](https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937/6 "2022-06-28T10:53:37Z")

</div>

To be more specific 🙂

1. we are making use of `Laminas/Di/Di` and as per documentation, changing it to `Laminas/Di/Injector` gives us error related to `Laminas\Di\Injector` could not be resolved to a factory.
2. If we try using it with `laminas-servicemanager` as suggested for use of IOT, the steps mentioned merely installing `laminas-di` with `laminas-component-installer` should make things work but it doesn’t.
3. We modified the configuration array from `di` key to `dependencies => auto` key as suggested in one of the documentation of [laminas.dev](http://laminas.dev/), but that does not seem to work.Background, we migrated from zf2 to laminas-2 and now we have migrated to laminas-3 with respect to the dependencies but the changes need to be done for migration of laminas dependencies v2 to laminas dependencies v3. Also we need to make changes to code as it appears zf2 code needs to be updated to zf3 (which in most documentations mentioned, has to be done prior to migrating to laminas). So is it possible and what are the simplest steps to migrate for the above changes?

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [June 28, 2022, 11:03am UTC](https://discourse.laminas.dev/t/upgrading-laminas-version-3-from-laminas-version-2/2937/7 "2022-06-28T11:03:53Z")

</div>

Looking at these traces:

> > ![](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nilamrsharma/45/1323_2.png "nilamrsharma") | [nilamrsharma](https://discourse.laminas.dev/u/nilamrsharma)  
> > June 28 |
> > 
> > - | - |
> 
> Thank you for quick reply, Below errors are occurring now ,
> 
> ```auto
> [Wed Jun 15 23:23:06.944030 2022] [php:notice] [pid 22] [client [172.17.0.1:21991](http://172.17.0.1:21991)] Exception: Call to a member function addFileChannel() on null --- Backtrace: #0 /var/www/shipwire.www/swclient/vendor/shipwire/internal-shipwire-api-client/src/Shipwire/ApiClient/AbstractController.php(226): Shipwire\\ApiClient\\AbstractController->logAccess()\n#1 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Shipwire\\ApiClient\\AbstractController->onDispatch()\n#2 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\\EventManager\\EventManager->triggerListeners()\n#3 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#4 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(307): Laminas\\Mvc\\Controller\\AbstractController->dispatch()\n#5 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\\Mvc\\Controller\\AbstractRestfulController->dispatch()\n#6 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\\Mvc\\DispatchListener->onDispatch()\n#7 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\\EventManager\\EventManager->triggerListeners()\n#8 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#9 /var/www/shipwire.www/swclient/public/index.php(15): Laminas\\Mvc\\Application->run()\n#10 {main}, referer: [https://merchant.developer.corp.shipwire.com/index/login](https://merchant.developer.corp.shipwire.com/index/login)
> 
> ```

This one looks like `shipwire/internal-shipwire-api-client` is at fault: nothing really framework-related. Looks like a missing dependency?

> ```auto
> [Thu Jun 16 00:45:33.497009 2022] [php:notice] [pid 29] [client [172.17.0.1:41805](http://172.17.0.1:41805)] Exception: Service with name "json-pp" could not be created. Reason: Could not resolve value for parameter "vars" of type any in class Shipwire\\ApiClient\\PostProcessor\\Json (requested as json-pp) --- Backtrace: #0 /var/www/shipwire.www/swclient/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\\ServiceManager\\ServiceManager->doCreate()\n#1 /var/www/shipwire.www/swclient/module/Main/Module.php(793): Laminas\\ServiceManager\\ServiceManager->get()\n#2 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Main\\Module->errorProcess()\n#3 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\\EventManager\\EventManager->triggerListeners()\n#4 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/DispatchListener.php(146): Laminas\\EventManager\\EventManager->triggerEvent()\n#5 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\\Mvc\\DispatchListener->onDispatch()\n#6 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\\EventManager\\EventManager->triggerListeners()\n#7 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#8 /var/ww
> 
> ```

Similar here: looks like your `json-pp` requires arguments that are not being provided? Possibly change in constructor signature? Also here, not related to the framework.

> ```auto
> Exception: Too few arguments to function Shipwire\\Log\\ErrorHandling::errorHandler(), 4 passed in /var/www/shipwire.www/shopify-layer/module/Main/Module.php on line 90 and exactly 5 expected --- Backtrace: #0 /var/www/shipwire.www/shopify-layer/module/Main/Module.php(90)Laminas\\EventManager\\EventManager->triggerListeners()\n#3 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(154): Laminas\\EventManager\\EventManager->triggerEvent()\n#4 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(266): Laminas\\Mvc\\Application->bootstrap()\n#5 /var/www/shipwire.www/shopify-layer/public/index.php(15): Laminas\\Mvc\\Application::init()\n#6 {main}
> [php:notice] [pid 15] [client [10.42.0.21:44868](http://10.42.0.21:44868)] ====== OnBoostrap Load =======, referer: [https://shopify.developer.corp.shipwire.com/](https://shopify.developer.corp.shipwire.com/)
> [php:notice] [pid 15] [client [10.42.0.21:44868](http://10.42.0.21:44868)] Exception: Too few arguments to function Shipwire\\Log\\ErrorHandling::errorHandler(), 4 passed in /var/www/shipwire.www/shopify-layer/module/Main/Module.php on line 90 and exactly 5 expected --- Backtrace: #0 /var/www/shipwire.www/shopify-layer/module/Main/Module.php(90): Shipwire\\Log\\ErrorHandling::errorHandler()\n#1 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Main\\Module->onBootstrap()\n#2 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\\EventManager\\EventManager->triggerListeners()\n#3 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(154): Laminas\\EventManager\\EventManager->triggerEvent()\n#4 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(266): Laminas\\Mvc\\Application->bootstrap()\n#5 /var/www/shipwire.www/shopify-layer/public/index.php(15): Laminas\\Mvc\\Application::init()\n#6 {main}, referer: [https://shopify.developer.corp.shipwire.com/](https://shopify.developer.corp.shipwire.com/) (edited) 
> 
> ```
> 
> We are getting many error but for now stuck in these above error

Also here, looks like a change of signature in shipwire’s logger.
