I am new to Magento, and I am trying to do add my very first module. I tried to follow two tutorials that show how to create a "Hello World" module, which basically shows a 'Hello World!' message on the website; I have installed the sample data. Both sample page and admin page are working fine. What I have been trying is the following:

  1. Create folder Magentoexplorer (http://magentoexplorer.com/how-to-build-hello-world-magento-2-module-from-scratch)

  2. Inside this folder, there is another folder, 'etc', which has the file module.xml inside of it. In the Magentoexplorer folder I have registration.php. The codes are copied from the example in the link I provided, see them at the end of the post.

  3. In windows CMD (I have Magento 2.1.2 installed over WAMP server), I do php magento setup:upgrade. It seems that it's working. I get the message 'please re-run Magento compile command', though. In a forum I read that this may be not necessary in developer mode. But I tried to do it anyway, just in case. I got the message 'Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in C:\wamp64\www\magento\vendor\zendframework\zend-code\src\Scanner\FileScanner.php on line 36'. I tried to go to php.ini and change the memory_limit to 1G. However, the error kept persisting.

  4. In the tutorials they advice to put code in app/code. In the version I downloaded I don't have this folder; for what I understood, my code is instead in the vendor/magento folder. I tried to put my module in first one folder, then in the other (I created app/code folder).

  5. I modified the magento config.php file adding a line at the end with 'Magentoexplorer_Helloworld' => 1'.

  6. When I tried to list the modules (php magento module:status), it didn't appear. I also tried 'php magento module:enable Magentoexplorer_Helloworld', but I got the error Unknown module(s): 'Magentoexplorer_Helloworld', which disappeared after modifying the config.php file, but then I couldn't see the admin page, nor the module.

  7. I am trying to understand what the composer does and how to use it, but in the tutorials they don't put it as a requisite for the module to be shown.

Is the composer necessary for the module to appear and work? I am new to php and Magento, and I am trying to learn by myself and searched everywhere but I still cannot figure out what is happening. Do you see any errors in what I have been trying? Am I missing something?





<?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="Magentoexplorer_Helloworld" setup_version="1.0.0" / >

Any help or comment will be much appreciated.


  • share you code here. so we can see what is problem also did you tried this php bin/magento setup:upgrade Oct 24, 2016 at 8:06
  • Thanks for answering. Yes I did as I said. I am editing the post with the code. Do you know if a composer.json file is mandatory in order for the module to appear listed?
    – Xavier
    Oct 24, 2016 at 8:08
  • Also, I don't know if I am putting the folder in the right place. I mean, the folder 'Magentoexplorer' would be the vendor folder? And 'Helloworld' would be the module name?
    – Xavier
    Oct 24, 2016 at 8:23
  • I just tried to put in app/code a Magentoexplorer folder; inside of it, Helloworld folder. Inside, the file registration.php; inside, etc, which module.xml. Then I run magento modue:status, and the first things appearing before the enabled modules is the code of registration.php! Any idea of why this is happening?
    – Xavier
    Oct 24, 2016 at 8:27
  • i think you didn't use the <?php code so it treat it as html code Oct 24, 2016 at 9:17

1 Answer 1


you file path must be


    "name": "magentoexplorer/helloworld",
    "description": "my module",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/module-catalog": "101.0.*",
        "magento/module-config": "100.0.*",
        "magento/module-store": "100.0.*",
        "magento/module-customer": "100.1.*",
        "magento/module-backend": "100.0.*",
        "magento/framework": "100.0.*"
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
    "autoload": {
        "files": [
        "psr-4": {
            "Magentoexplorer\\Helloworld\\": ""



now run the cmd php bin/magento setup:upgrade

  • 1
    It worked! Thank you so much, I have been some days struggling with this.
    – Xavier
    Oct 24, 2016 at 9:53
  • @Xavier everyone struggle in beginning so don't worry.. Oct 24, 2016 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.