Facing this issue:

1 exception(s): Exception #0 (ReflectionException): Class mygateway does not exist

Don't know where I find this class in my module Please help.

Here's my code:


<?xml version="1.0"?>
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
                <merchant_gateway_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
                <title>My Gateway</title>
                <blocks>Myname_Mygateway_Block </blocks>

1 Answer 1


Issues like the one you mentioned can have several reasons. The following command sequence will check the dependencies and regenerates the code.

Remove generated code pieces to make sure we have a clean workspace

rm -rf var/cache/* var/di/* var/generation/* var/page_cache/* var/view_preprocessed/* pub/static/frontend/* vendor

Install composer dependencies

composer install

Compile DI Classes

php bin/magento setup:di:compile

Compile Static Files

php bin/magento setup:static-content:deploy

Set Permissions

chmod -R www-data:www-data && find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor ( -type f -or -type d ) -exec chmod u-w {} \; && chmod o-rwx app/etc/env.php && chmod u+x bin/magento

I hope it will help to solve your problem.

  • repo.magento.com) username: where I got this username ???? Oct 11, 2018 at 11:01
  • It is your magento.com account. Oct 11, 2018 at 11:03
  • how can i revert back it any command ? Oct 11, 2018 at 11:14
  • i purchased my theme from envato i dont know username and password and my site is locked need composer install to run but i dint know username and passsword please help Oct 11, 2018 at 11:16
  • What does mean by revert back? you can stop command execution by ctrl + c Oct 11, 2018 at 11:16

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.