cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal error: Trait 'Magento\Framework\Interception\Interceptor' not found issue

SOLVED

Fatal error: Trait 'Magento\Framework\Interception\Interceptor' not found issue

My client site suddenly get down today. I tried to running php/magento deploy:mode:set developer. The terminal showing the error: Fatal error: Trait 'Magento\Framework\Interception\Interceptor' not found in generated/code/Magento/Framework/App/Http/Interceptor.php on line 7

I have tried 

chmod  777 -R  var/* pub/* generated/*

And I also tried rm generated/* but still not working.

 

Now no matter what command line I ran (eg. bin/magento setup:upgrade; bin/magento deploy:mode:show and so on) , I always get this error.

Anyone can help! Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Fatal error: Trait 'Magento\Framework\Interception\Interceptor' not found issue

Finally fix this issue.

 

Somehow interceptor.php file is missing in vendor/magento/framework/Interception/

We copied the file from another account and then it's working....

View solution in original post

2 REPLIES 2

Re: Fatal error: Trait 'Magento\Framework\Interception\Interceptor' not found issue

Hello @grace_li 

 

Try this

Set the file permissions correctly: Ensure that the var/, pub/, and generated/ directories have the correct file permissions. Instead of setting the permissions to 777, it's recommended to use more restrictive permissions. You can set the permissions to 755 for directories and 644 for files. Use the following commands to set the permissions:

 

find var/ pub/ generated/ -type d -exec chmod 755 {} \;
find var/ pub/ generated/ -type f -exec chmod 644 {} \;

 

 Remove the generated code: Run the following command to remove the generated code:

rm -rf generated/*

Regenerate the code: Once the generated code is removed, you can regenerate it using the following command:

bin/magento setup:di:compile

This command will recompile the dependency injection configuration and regenerate the necessary code files.

After regenerating the code, it's advisable to clear the cache to ensure that the changes take effect. Use the following command to clear the cache

bin/magento cache:flush

Additionally, if you have a separate opcode cache (e.g., APC, OPcache), consider restarting or flushing the opcode cache as well.

 

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Fatal error: Trait 'Magento\Framework\Interception\Interceptor' not found issue

Finally fix this issue.

 

Somehow interceptor.php file is missing in vendor/magento/framework/Interception/

We copied the file from another account and then it's working....