Question

I'm running into following fatal error when trying to execute the setup:di:compile command:

Fatal error: Cannot declare class Migration\Step\Version11410to2000Test, because the name is already in use in /var/www/html/magento/vendor/magento/data-migration-tool/tests/unit/testsuite/Migration/Step/UrlRewrite/Version11410to2000Test.php on line 109

I tried to re-compile because I was getting an 404 on backend (triggered by magento, not apache websever).

Any help appreciated.

Edit: It is a fresh Magento 2 install, except for adding the official (and correct) data-migration-tool.

Was it helpful?

Solution

change and give different class name for your controller class

this might be issue because your controller class name also used by some other controller

example shown in below url

https://stackoverflow.com/questions/708140/php-fatal-error-cannot-redeclare-class

And if this is the not case then

please delete di folder in var

OTHER TIPS

A more direct answer to this problem is:

At the top of the file: {magento-base}/vendor/magento/data-migration-tool/tests/unit/testsuite/Migration/Step/UrlRewrite/Version11410to2000Test.php

Replace:

namespace Migration\Step;

With:

namespace Migration\Step\UrlRewrite;
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top