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 {} ;
-
Did you tried with composer install onceVenkat– Venkat2021年12月18日 04:25:07 +00:00Commented 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– P. Paul2021年12月18日 07:35:47 +00:00Commented 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-rootPhilipp Sander– Philipp Sander2021年12月23日 08:34:18 +00:00Commented 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– Venkat2021年12月27日 04:10:21 +00:00Commented Dec 27, 2021 at 4:10
2 Answers 2
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.
-
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– P. Paul2021年12月24日 09:07:17 +00:00Commented Dec 24, 2021 at 9:07
-
1ex: sudo chown -R root:root . => where root is folder owner, you need to add folder owner nameVenkat– Venkat2021年12月27日 04:07:32 +00:00Commented 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, writewhoto get the current user. After that replace{{YOUR_USER_NAME}}with the user you got from thewhocommandPetar Borisovski– Petar Borisovski2021年12月27日 08:32:07 +00:00Commented 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– P. Paul2021年12月28日 03:02:27 +00:00Commented Dec 28, 2021 at 3:02
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