Pino
March 13, 2020, 9:44am
1
Hello.
I am creating a new website with Magento 2. I have received several warnings on Zend Framework with Composer and so I followed instructions to Migrate to Laminas.
Everything seems to have gone well.
But now I can’t run several commands (for example the operations of data-migration tool)
The error is always the same:
PHP Fatal error: Cannot declare class Zend\Mvc\Controller\LazyControllerAbstractFactory, because the name is already in use in /var/www/html/magento2/setup/src/Zend/Mvc/Controller/LazyControllerAbstractFactory.php on line 78
I can’t get over the problem.
Can someone help me?
Hello and welcome to the forums!
so I followed instructions to Migrate to Laminas.
Don’t do that and ignore the message. Everything will run without the migration.
Migrate only your own code and not the code from external libraries or dependencies.
There are already issue reports for this topic:
opened 02:02AM - 10 Jan 20 UTC
closed 06:40PM - 24 Mar 20 UTC
Issue: Ready for Work
Issue: Confirmed
Issue: Format is valid
Component: Composer
Reproduced on 2.4.x
Fixed in 2.4.x
Reported on 2.4.0
# Summary of the issue
Please see in the latest dev branch https://github.com/… magento/magento2/blob/ad9e1f08a07fa318a997958c6ecb86f2cddce134/composer.json#L55
You'll notice that, in all branches of this repository, it still refers to `zendframework` in spite of that package being abandoned. This results in a `composer install` which looks like:
```
Package zendframework/zend-barcode is abandoned, you should avoid using it. Use laminas/laminas-barcode instead.
Package zendframework/zend-captcha is abandoned, you should avoid using it. Use laminas/laminas-captcha instead.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
```
I've seen another ticket for this [here](https://github.com/magento/magento2/issues/25567), but it was promptly closed since the dev could not replicate the issue. But the issue is plainly visible in the most recent `composer.json` file. Magento needs to recognise that zend is being transitioned to laminas and update its dependencies accordingly.
# Information on your environment
Ubuntu 18, Magento 2.3, although the issue can be seen in the source code for 2.4 as well.
### Preconditions (*)
Magento 2.4-develop
### Steps to reproduce (*)
Run a `composer install` on any version of Magento
### Expected result (*)
Expect to see no `abandoned` messages.
### Actual result (*)
```
Package zendframework/zend-barcode is abandoned, you should avoid using it. Use laminas/laminas-barcode instead.
Package zendframework/zend-captcha is abandoned, you should avoid using it. Use laminas/laminas-captcha instead.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
```
![image](https://user-images.githubusercontent.com/51681379/72522967-7a212180-3867-11ea-9316-ea75730a874b.png)
opened 08:37AM - 02 Jan 20 UTC
closed 08:29PM - 24 Mar 20 UTC
Using composer on a Magento project recently started giving the following warnin… gs:
```
Package zendframework/zend-barcode is abandoned, you should avoid using it. Use laminas/laminas-barcode instead.
Package zendframework/zend-captcha is abandoned, you should avoid using it. Use laminas/laminas-captcha instead.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-config is abandoned, you should avoid using it. Use laminas/laminas-config instead.
Package zendframework/zend-console is abandoned, you should avoid using it. Use laminas/laminas-console instead.
Package zendframework/zend-db is abandoned, you should avoid using it. Use laminas/laminas-db instead.
Package zendframework/zend-di is abandoned, you should avoid using it. Use laminas/laminas-di instead.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package zendframework/zend-filter is abandoned, you should avoid using it. Use laminas/laminas-filter instead.
Package zendframework/zend-form is abandoned, you should avoid using it. Use laminas/laminas-form instead.
Package zendframework/zend-http is abandoned, you should avoid using it. Use laminas/laminas-http instead.
Package zendframework/zend-hydrator is abandoned, you should avoid using it. Use laminas/laminas-hydrator instead.
Package zendframework/zend-i18n is abandoned, you should avoid using it. Use laminas/laminas-i18n instead.
Package zendframework/zend-inputfilter is abandoned, you should avoid using it. Use laminas/laminas-inputfilter instead.
Package zendframework/zend-json is abandoned, you should avoid using it. Use laminas/laminas-json instead.
Package zendframework/zend-loader is abandoned, you should avoid using it. Use laminas/laminas-loader instead.
Package zendframework/zend-log is abandoned, you should avoid using it. Use laminas/laminas-log instead.
Package zendframework/zend-mail is abandoned, you should avoid using it. Use laminas/laminas-mail instead.
Package zendframework/zend-math is abandoned, you should avoid using it. Use laminas/laminas-math instead.
Package zendframework/zend-mime is abandoned, you should avoid using it. Use laminas/laminas-mime instead.
Package zendframework/zend-modulemanager is abandoned, you should avoid using it. Use laminas/laminas-modulemanager instead.
Package zendframework/zend-mvc is abandoned, you should avoid using it. Use laminas/laminas-mvc instead.
Package zendframework/zend-psr7bridge is abandoned, you should avoid using it. Use laminas/laminas-psr7bridge instead.
Package zendframework/zend-serializer is abandoned, you should avoid using it. Use laminas/laminas-serializer instead.
Package zendframework/zend-server is abandoned, you should avoid using it. Use laminas/laminas-server instead.
Package zendframework/zend-servicemanager is abandoned, you should avoid using it. Use laminas/laminas-servicemanager instead.
Package zendframework/zend-session is abandoned, you should avoid using it. Use laminas/laminas-session instead.
Package zendframework/zend-soap is abandoned, you should avoid using it. Use laminas/laminas-soap instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Package zendframework/zend-uri is abandoned, you should avoid using it. Use laminas/laminas-uri instead.
Package zendframework/zend-validator is abandoned, you should avoid using it. Use laminas/laminas-validator instead.
Package zendframework/zend-view is abandoned, you should avoid using it. Use laminas/laminas-view instead.
```
Zendframwork now has a new name: Laminas, more info over here: https://framework.zend.com/blog/2019-04-17-announcing-laminas.html
Laminas has some documentation and tools for migrating, Magento should probably take a good look at this and see how easy we can migrate: https://getlaminas.org/blog/2019-12-31-out-with-the-old-in-with-the-new.html
Will probably be fun to stay backwards compatible, because of namespace changes, maybe the 2.4 milestone can be used for this since it hasn't been released yet?
Pino
March 13, 2020, 2:09pm
3
So can I avoid migration to Laminas?
Now that I’ve already done it, is there a way to go back or is it better to reinstall Magento 2 from scratch?
Will probably be the best and easiest way.