# Class not found Error after migration

**URL:** <https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772>\
**Category:** Migration\
**Created:** [August 5, 2020, 9:08am UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772 "2020-08-05T09:08:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhausch](https://avatars.discourse-cdn.com/v4/letter/b/91b2a8/32.png) [@bhausch](https://discourse.laminas.dev/u/bhausch)\
**Post date:** [August 5, 2020, 9:08am UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/1 "2020-08-05T09:08:08Z")

</div>

After migration from ZF2 to laminas (MVC) we got a class not found error/warning and our application is not running.

Warning: Class ‘Laminas\View\HelperPluginManager’ not found in PATH/vendor/laminas/laminas-zendframework-bridge/src/Autoloader.php on line _116_

Class HelperPluginManager exists in path vendor/laminas/laminas-view/src. The files in this folder and its subfolders are still in the Zend namespace. Is that correct?

Are there any ideas for a solution of this issue?

STACK:

| # | Time | Memory | Function | Location |
| --- | --- | --- | --- | --- |
| 1 | 0.1297 | 364792 | {main}( ) | …/index.php:0 |
| 2 | 0.9047 | 379504 | Laminas\Mvc\Application::init( ??? ) | …/index.php:59 |
| 3 | 0.9300 | 672944 | Laminas\ModuleManager\ModuleManager-\>loadModules( ) | …/Application.php:252 |
| 4 | 1.0732 | 791688 | Laminas\EventManager\EventManager-\>trigger( ???, ???, ???, ??? ) | …/ModuleManager.php:122 |
| 5 | 1.0732 | 791688 | Laminas\EventManager\EventManager-\>triggerListeners( ???, ???, ??? ) | …/EventManager.php:204 |
| 6 | 1.0733 | 794296 | call\_user\_func:{[PATH]/vendor/laminas/laminas-eventmanager/src/EventManager.php:443} ( ???, ??? ) | …/EventManager.php:443 |
| 7 | 1.0733 | 794296 | Laminas\ModuleManager\Listener\ServiceListener-\>onLoadModulesPost( ??? ) | …/EventManager.php:443 |
| 8 | 1.0794 | 850296 | Laminas\ServiceManager\ServiceManager-\>get( ???, ??? ) | …/ServiceListener.php:211 |
| 9 | 1.0794 | 851048 | Laminas\ServiceManager\ServiceManager-\>create( ??? ) | …/ServiceManager.php:529 |
| 10 | 1.0794 | 851048 | Laminas\ServiceManager\ServiceManager-\>doCreate( ???, ??? ) | …/ServiceManager.php:597 |
| 11 | 1.0794 | 851048 | Laminas\ServiceManager\ServiceManager-\>createFromFactory( ???, ??? ) | …/ServiceManager.php:637 |
| 12 | 1.0797 | 852592 | Laminas\ServiceManager\ServiceManager-\>createServiceViaCallback( ???, ???, ??? ) | …/ServiceManager.php:1096 |
| 13 | 1.0797 | 852672 | call\_user\_func:{[PATH]vendor/laminas/laminas-servicemanager/src/ServiceManager.php:938} ( ???, ???, ???, ??? ) | …/ServiceManager.php:938 |
| 14 | 1.0797 | 852672 | Laminas\Mvc\Service\ViewHelperManagerFactory-\>createService( ???, ???, ??? ) | …/ServiceManager.php:938 |
| 15 | 1.0797 | 852672 | Laminas\Mvc\Service\ViewHelperManagerFactory-\>createService( ??? ) | …/ViewHelperManagerFactory.php:43 |
| 16 | 1.0797 | 852736 | spl\_autoload\_call ( ??? ) | …/AbstractPluginManagerFactory.php:31 |
| 17 | 1.0797 | 852800 | Laminas\ZendFrameworkBridge\Autoloader::Laminas\ZendFrameworkBridge{closure:[PATH]/vendor/laminas/laminas-zendframework-bridge/src/Autoloader.php:89-118}( ??? ) | …/AbstractPluginManagerFactory.php:31 |
| 18 | 1.0800 | 858120 | class\_alias ( ???, ??? ) | …/Autoloader.php:116 |

---

<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:** [August 5, 2020, 10:49pm UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/2 "2020-08-05T22:49:48Z")

</div>

This looks like a bug: if it is possible to create a small reproducer, consider opening an issue on `laminas/laminas-zendframework-bridge`, so that someone can investigate it.

---

<div class="post-metadata">

**Author:** ![samsonasik](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/samsonasik/32/777_2.png) [@samsonasik](https://discourse.laminas.dev/u/samsonasik)\
**Post date:** [August 6, 2020, 8:58am UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/3 "2020-08-06T08:58:31Z")

</div>

I suggest to migrate a ZF2 app to ZF3 app first, then to Laminas

---

<div class="post-metadata">

**Author:** ![trungnv](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/trungnv/32/786_2.png) [@trungnv](https://discourse.laminas.dev/u/trungnv)\
**Post date:** [September 9, 2020, 6:13am UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/4 "2020-09-09T06:13:48Z")

</div>

I got the same error with migrating Zend 2 to Laminas, after the migrated I get the following error:

`Class 'Laminas\View\HelperPluginManager' not found in vendor\laminas\laminas-zendframework-bridge\src\Autoloader.php Fatal error</b> : Cannot declare class Zend\View\HelperPluginManager, because the name is already in use`

I check socurce code of laminas/laminas-view component and see that the namespace of this component is Zend.

![image](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/1X/48167d474dca24d09383373b50f7a1c1d7a9431b.png)

Version of laminas/laminas-view is 2.3.  
Please help me for resolve it.

---

<div class="post-metadata">

**Author:** ![devnode](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/devnode/32/1316_2.png) [@devnode](https://discourse.laminas.dev/u/devnode)\
**Post date:** [June 4, 2022, 6:20pm UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/5 "2022-06-04T18:20:03Z")

</div>

is it solved for anyone? @trungnv @bhausch? I got the same issue. Please reply

---

<div class="post-metadata">

**Author:** ![devnode](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/devnode/32/1316_2.png) [@devnode](https://discourse.laminas.dev/u/devnode)\
**Post date:** [June 7, 2022, 11:49am UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/6 "2022-06-07T11:49:46Z")

</div>

@samsonasik @ocramius do you have any idea?

---

<div class="post-metadata">

**Author:** ![rajath](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@rajath](https://discourse.laminas.dev/u/rajath)\
**Post date:** [August 2, 2022, 5:02pm UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/7 "2022-08-02T17:02:26Z")

</div>

Hi

I had a similar error, add/update your composer autoload psr entry  
and do a

> composer dump-autoload

---

<div class="post-metadata">

**Author:** ![jmckay56](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/jmckay56/32/1409_2.png) [@jmckay56](https://discourse.laminas.dev/u/jmckay56)\
**Post date:** [December 5, 2022, 5:30pm UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/8 "2022-12-05T17:30:02Z")

</div>

Hi @rajath  
Could you be more specific on the changes required to update composer autoload psr entry?

Thanks you.

---

<div class="post-metadata">

**Author:** ![gustavocardozo](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/gustavocardozo/32/1434_2.png) [@gustavocardozo](https://discourse.laminas.dev/u/gustavocardozo)\
**Post date:** [January 25, 2023, 2:33pm UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/9 "2023-01-25T14:33:17Z")

</div>

I add these lines in my composer.json

“autoload”: {  
“psr-4”: {“Laminas\View\”: “src/”}  
}

and later run: composer dump-autoload

This worked for my

---

<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:** [January 26, 2023, 10:05am UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/10 "2023-01-26T10:05:53Z")

</div>

Hello and welcome to our forums! 😃

> [@gustavocardozo](#):
>
> I add these lines in my composer.json
> 
> “autoload”: {  
> “psr-4”: {“Laminas\View\”: “src/”}  
> }

This is not necessary if all the required components of Laminas are correctly installed, because they already bring exactly these lines:

> <https://github.com/laminas/laminas-view/blob/ba66ad7479867886bcf9a02bc7743a85a0399d18/composer.json#L78-L82>

---

<div class="post-metadata">

**Author:** ![Kimneyyy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/kimneyyy/32/1620_2.png) [@Kimneyyy](https://discourse.laminas.dev/u/Kimneyyy)\
**Post date:** [November 14, 2023, 9:42pm UTC](https://discourse.laminas.dev/t/class-not-found-error-after-migration/1772/11 "2023-11-14T21:42:11Z")

</div>

Hi, does anyone have a working solution. None of these solutions work for me.
