Why do Magento 2 extension installation instructions tell me to unzip their file to the root and then run command?

magento.stackexchange https://magento.stackexchange.com/questions/148108

Question

I'm not a developer, and I have learned Magento 2 (my store was installed with Magento 2.1.2 through Softaculous on Cpanel) in the past 3 weeks. I don't mind learning. I'm sure there are many others similar to me trying to install and run their own stores with no dedicated web infrastructure and huge budget. So this is a question that will hopefully help my understanding as well as theirs.

I had to ask for help with installing several extensions in my store. Some are free and some have been paid for. I followed the directions of these extensions and most tell me to:

  1. "Unzip the file my-great-extension.zip into your Magento root folder". I'm well aware that the root folder of the Magento 2 installation is the folder where your Magento 2 store is installed, the same folder containing the directories "app" and "pup" and "var" and "vendor".

  2. The next step is usually a miffing "enable the extension". Once in a while, they explain the command line code to enable the extension: bin/magento module:enable my-great-extensions-name but usually not.

  3. Clear the cache, again not very specific to people that don't know Magento 2.

Usually, this ends up, if I followed the directions to the "T", in an error message at the command line:

"Unknown module(s): 'my great unknown module does not exist because i gave you the wrong installation instructions'"

THEN, I ask for help. Now after the first time, I figured out that these instructions were either wrong or not applicable to my installation. The upload was never to the root directory. I was following instructions, but I was ACTUALLY supposed to the uploaded the unzipped files to the app -> code directory WITHOUT OVERWRITING OTHER FILES IN THERE and mimic the unzipped file structure.

So this is where the problem comes in along with my questions?

  1. Firstly, are installation instructions different for every variation of the same Magento release store. Meaning, are the installation methods different for every Magento 2.1.2 store? Or IS THERE A STANDARD INSTALLATION PROCEDURE FOR MANUAL INSTALLS OF EXTENSIONS.

  2. Are the installation instructions that I'm so often given by documentation for extensions even the CORRECT instructions? Now not speaking about the free extensions, but it seems to me that this is a good way for extension developers to make a little extra money per installation, which I'm all for, but it should be stated like so, and not swindled. (no offense to the developers, we all love what you folks do and wish we could do it too).

  3. Is my Magento installation incorrect?

Sorry for the slight rant, but I'd still like to find the right way to install extensions. Some come with more then just the "code" folder in it, in those cases, am I supposed to copy over they others as well? It's almost never that well documented.

EDIT FOR THE DOWNVOTERS...if your an extension maker, it's probably a good idea to be clear about install instructions for your extensions. Just as the person that answered this was.

Was it helpful?

Solution

You can confirm your extension name in registration.php file of app/code/MyGreatExtensions/ModuleName

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
   'MyGreatExtensions_ModuleName',
    __DIR__
); 

and make sure your extension path is something like app/code/MyGreatExtensions/ModuleName

enter image description here

here, MyGreatExtensions is your extension namespace and ModuleName is your extension module name.

after unzip you have to follow below instruction:

  1. Enable your extension

    php bin/magento module:enable MyGreatExtensions_ModuleName

  2. Setup upgrade

    php bin/magento setup:upgrade

  3. Remove var/di, var/generation folder

    php bin/magento setup:di:compile

  4. Remove pub/static folder [OPTIONAL] may be your extension has overrides some core code(JS, CSS, etc).

    php bin/magento setup:static-content:deploy

  5. Set proper permission for your Magento store

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top