0

I attempted to install a Mageplaza blog extension and it caused the site to hit a 500 error afterwards. I removed the extension and ran numerous commands such:

php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile

removed and readded the .htaccess file within the root directory.

nothing worked, it still shows the 500 error on both frontend and admin area.

3 Answers 3

1

Please run permission command

chmod -R 777 var/ pub/ generated/

and check the server log for the exact issue.

0
1

Please try to give permissions like sudo chmod -R 777 var/ pub/ generated/ and try again and check the exception log in var/log folder.

0

you need to identify the exact root cause of the issue which throws the 500 internal server error to get this sorted out. Just like you check the browser console to fix the javascript issues if you are UI developer / UX designer

Simply running these commands to flush cache, recompile and regenerate the code etc is not a magical fix most of the times to get rid of this 500 issue, based on my magento2 development experience.

To identify the issue, at first confirm your store runs on which mode by running the

bin/magento deploy:mode:show

If you are on production mode, then check your Magento application logs like system.log / debug.log / exception.log as exception printing / showing the error explicitly to the user is disabled on production mode. Also check the var/report directory to find the latest issue reported. Besides these check your webserver logs to identify the 500 server error.

If your store is not yet launched to public access, then deploy your store to development mode, as it's ideal for development and the errors or warnings will be explicit.

bin/Magento deploy:mode:set developer

Besides this make sure your module is disabled and removed cleanly from the codebase. If you've installed the module through composer then follow the right composer commands to remove the vendor module/package from the codebase.

Also remove all the contents from the generated directory

rm -rf generated/*

and recompile

bin/magento s:d:c

If necessary regenerate the static files

bin/magento s:s:d -f

make sure to reset the directory and file permissions and try reload.

As you have issues in both storefront and admin/backend, I believe removing the contents from generated/ directory and recompile will get this issue sorted out in case if you face this issue only after this module installation/ installation.

Also consider using XDebug tool to identify the exact cause of this issue if you have tried the other ways mentioned above.

This is the right and recommended approach to sort this 500 error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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