cancel
Showing results for 
Search instead for 
Did you mean: 

Magento doesn't recognize module

SOLVED

Magento doesn't recognize module

I have created new module but when I run the command 

magento module:status

 I couldn't see my module name neither in enabled or disabled list

my registeration.php code :

 

<?php
 
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Demo_Helloworld',
    __DIR__
);

the module.xml

 

<?xml version="1.0"?>
 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Demo_Helloworld" setup_version="1.0.0">
    </module>
</config>

why I can't see my module name in the module list?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento doesn't recognize module

@mbussnsgmafa14 

You'll get the required solution from the below solution:

 

1. Create module.xml at app/code/Meetanshi/Extension/etc 

In module.xml file, copy and paste this code.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Meetanshi_Extension" setup_version="1.0.0">
    </module>
</config>

Now, you also need to create a file that is registration.php.

 

2. Create registration.php at app/code/Meetanshi/Extension

 

<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
    ComponentRegistrar::MODULE,
    'Meetanshi_Extension',
    __DIR__
);

These two files are mandatory to create and get started with extension development.

After creating module.xml and registration.php files, the next step is to execute commands in the command line.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Run these three commands and your extension will appear in app/etc/config.php.

 

If the command gives output ‘0’, that indicates the extension is disabled. On the other hand, if the command shows output ‘1″, it explains that the extension is enabled and all the functionalities of the extension are working smoothly.

 

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

2 REPLIES 2

Re: Magento doesn't recognize module

@mbussnsgmafa14 

You'll get the required solution from the below solution:

 

1. Create module.xml at app/code/Meetanshi/Extension/etc 

In module.xml file, copy and paste this code.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Meetanshi_Extension" setup_version="1.0.0">
    </module>
</config>

Now, you also need to create a file that is registration.php.

 

2. Create registration.php at app/code/Meetanshi/Extension

 

<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
    ComponentRegistrar::MODULE,
    'Meetanshi_Extension',
    __DIR__
);

These two files are mandatory to create and get started with extension development.

After creating module.xml and registration.php files, the next step is to execute commands in the command line.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Run these three commands and your extension will appear in app/etc/config.php.

 

If the command gives output ‘0’, that indicates the extension is disabled. On the other hand, if the command shows output ‘1″, it explains that the extension is enabled and all the functionalities of the extension are working smoothly.

 

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Magento doesn't recognize module

Yes the steps are what I did, but unfortunately the mistake was because I have typo error in the name of the file  registration.php