cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 setup

Magento 2 setup

I have downloaded magento 2 and trying to install it on localhost but getting the following error

Fatal error: Uncaught ReflectionException: Class Magento\Framework\App\ResourceConnection\Proxy does not exist in /var/www/html/m2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php:26 Stack trace: #0 /var/www/html/m2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php(26): ReflectionClass->__construct('Magento\\Framewo...') #1 /var/www/html/m2/lib/internal/Magento/Framework/ObjectManager/Definition/Runtime.php(54): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...') #2 /var/www/html/m2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...') #3 /var/www/html/m2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #4 /var/www/html/m2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Mage in /var/www/html/m2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php on line 26

Thanks in advance.

5 REPLIES 5

Re: Magento 2 setup

@tarun_abc run the below commands.

 

sudo rm -rf var/cache/* generated/*
sudo chmod -R 777 var/ pub/static/ generated
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
sudo chmod -R 777 var/ pub/static/ generated/

Then check and let me know.

 

Thanks

Re: Magento 2 setup

Have you solved it? I am getting the same error. If you, Please let me know.

Re: Magento 2 setup

Have you solved the problem? I'm getting the same error too.

Re: Magento 2 setup

@paulosilva3a7b have you run the commands which i have mention above?

Re: Magento 2 setup

To resolve the "Class does not exist" error during Magento 2 installation, follow these steps:

  1. Check file permissions.
  2. Clear the cache by deleting the contents of the var/cache directory.
  3. Generate code using the commands:
    php bin/magento setup:di:compile php bin/magento setup:static-content: deploy -f
  4. Verify the PHP version and enabled extensions.
  5. Ensure your system meets Magento requirements.
  6. Reinstall dependencies with composer install.

These steps should help you overcome the error and successfully install Magento 2 on your localhost.