0

Thanks for the support...

I uploaded a theme update to Magento 2, and run all the commands needed (Please find them below), but I'm still getting "500 Internal Server Error error". And when I checked logs in "public_html/var/log/exception.log" I see the error

[2021-12-14 08:46:23] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/.../public_html/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []

Commands I already run several times...

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -f

chmod -R 0777 generated

find . -type f -exec chmod 644 {} ;

find . -type d -exec chmod 755 {} ;

find ./var -type d -exec chmod 777 {} ;

find ./pub/media -type d -exec chmod 777 {} ;

find ./pub/static -type d -exec chmod 777 {} ;

chmod 777 ./app/etc

chmod 644 ./app/etc/*.xml

rm -rf pub/static/*

rm -rf var/cache var/generation var/page_cache

find ./pub/media/catalog -type f -exec chmod 777 {} ;

4
  • Did you tried with composer install once
    – Venkat
    Dec 18, 2021 at 4:25
  • Hi @Venkat Thanks for your support. I'm not sure if you meant reinstalling composer? But yes, I did reinstall composer.
    – P. Paul
    Dec 18, 2021 at 7:35
  • whats your magento version? var/generation is from really old magento versions. it is now called "generated" and located in the shop-root Dec 23, 2021 at 8:34
  • Through this command [php bin/magento setup:di:compile] Interceptor class will generate. So please check generated folder permission. If its local environment give 777 permission on generated folder [sudo chmod -R 0777 generated]
    – Venkat
    Dec 27, 2021 at 4:10

2 Answers 2

0

If you have permission issues, try the following commands :

cd {{YOUR_PROJECTS_DIR}}/{{PROJECT_NAME}}
sudo find var/ generated/ vendor/ pub/static/ pub/media/ app/etc/ -type f -exec chmod g+w {} \;
sudo find var/ generated/ vendor/ pub/static/ pub/media/ app/etc/ -type d -exec chmod g+ws {} \;
sudo chown -R {{YOUR_USER_NAME}}:www-data . # make sure to run this from your host system!

This should fix any permission issues you have.

4
  • Hi Petar. Thanks for the support. I ran the commands you suggested, but when I got to the last one... "sudo chown -R {{YOUR_USER_NAME}}:www-data . # make sure to run this from your host system! I ran... sudo chown -R /home/USERNAME/public_html/vendor/magento/framework/Code/Reader/ClassReader.php But I get the error, "chown: missing operand after ‘/vendor/magento/framework/Code/Reader/ClassReader.php’
    – P. Paul
    Dec 24, 2021 at 9:07
  • 1
    ex: sudo chown -R root:root . => where root is folder owner, you need to add folder owner name
    – Venkat
    Dec 27, 2021 at 4:07
  • @P.Paul the last command is a linux command and has nothing to do with magento. {{YOUR_USER_NAME}} is the name of the current linux user. Firstly open the terminal, write who to get the current user. After that replace {{YOUR_USER_NAME}} with the user you got from the who command Dec 27, 2021 at 8:32
  • @PetarBorisovski Thanks! Yes, that's exactly what I did... I didn't want to post the cPanel username, that's why I replaced it in the comment with "USERNAME". So when I ran the command, I got the error, "chown: missing operand after ‘/vendor/magento/framework/Code/Reader/ClassReader.php"
    – P. Paul
    Dec 28, 2021 at 3:02
0

There might be some permission issues.

https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html

Try the following command once:

find . -type d -exec chmod 755 {} ; && find . -type f -exec chmod 644 {} ; && chmod u+x bin/magento

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.