Magento2 – Fix ReflectionException: Class Interceptor Does Not Exist

errormagento-frameworkmagento2

I'm getting this error on my homepage

ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:19 Stack trace: #0 /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo…') #1 /var/www/html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo…') #2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo…') #3 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo…', Array) #4 /var/www/html/vendor/magento/framework/App/Bootstrap.php(235): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo…', Array) #5 /var/www/html/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\Framewo…') #6 {main}

So I tried to setup:di:compile

I had an error in vendor/aheadworks/module-acr/Controller/Adminhtml/Wysiwyg/Directive.php

It was using a missing class use Magento\Framework\App\Action\HttpGetActionInterface;

So I wrote that class in order to make the setup:di:compile works

Compilation was started.
Interception cache generation… 7/7 [============================] 100% 31 secs 380.0 MiB
Generated code and dependency injection configuration successfully.

But I keep getting the same error on my main page, any ideas ?

Best Answer

Run the following commands.

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/
Related Topic