Chat on WhatsApp

What is the difference between registration.php and etc/module.xml?

registration.php tells Composer's autoloader where the module lives on disk — it runs at bootstrap and registers the namespace + path with ComponentRegistrar. Without it, Magento literally cannot find your code. etc/module.xml tells Magento's module manager the module exists, what its setup_version is, and its load-order dependencies via <sequence>. You need both: registration.php for the autoloader, module.xml for module:enable. A common bug is a working registration.php with a missing module.xml — the class loads, but DI etc/di.xml is silently ignored because the module is not enabled.

Was this helpful?