Problem after installing SMTP module with composer

Hi Craig,
I’ve been trying to install a solution to handle sending out the emails from my magento 2 site which was installed through following your videos.
So i decided to install mageplaza smtp module through composer.

However now when i go on www.mysite.co.uk i get the following error :

Autoload error

Module ‘Mageplaza_Core’ from ‘/var/www/html/app/code/Mageplaza/Core’ has been already defined in ‘/var/www/html/vendor/mageplaza/module-core’.

Any idea what it means and how to resolve the problem?

By the way i was an idiot and never backed the site up before trying to install the module… :scream:

Assumption

I’ve seen this a bunch. So, I’m going to make the following assumptions:

  • You’ve uploaded a theme/module that contains a Mageplaza module called Magento_Core in your app/ directory. For example, Porto Theme.
  • You’ve installed a module via composer than contains a Mageplaza module called Magento_Core that sits in your vendor/ directory.

Cause

The same module cannot exist in both locations. You’ll actually find this issue referenced in the Mageplaza FAQ as it’s so common.

Solution

Go ahead and delete the app/code/Mageplaza/Core folder, run the setup:upgrade, clear the cache etc and you’ll be good to go.

rm -rf app/code/Mageplaza/Core
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean

References

Edit: Fixed typo

1 Like

Thank you so much Craig for your quick reply.
I followed your steps and the site is back online now!!
I can also see the module in the back office now!
and bin/magento cache:clean works better :wink:
Cheers Mate!!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.