Solved: Exception Printing is Disabled by Default for Security Reasons in Magento 2
Ever faced an error of “Exception Printing is Disabled for Security Reasons” in your Magento 2 store?
If yes, keep reading, because the post explains the error, its cause and of course the solution 😃
What does Exception Printing is Disabled by Default for Security Reasons in Magento 2 means?
This message is a notification of an error, that isn’t displayed, to avoid system exploit.
It is a general error, usually occurring at the time of Magento 2 or extension update. You may face this error while installing a Magento 2 theme or module or anything goes wrong with cache folder.
The conflict between components like extensions or themes causes the “exception printing is disabled by default for security reasons” error in Magento 2.
Due to which, the Magento 2 cannot operate properly, living us developers in a mess!
But, we developers tend to find out the solution every time, isn’t it! 😎
Suggested Read:How to Throw Exception on Magento 2 Admin Save Configuration
Solution for Exception Printing is Disabled by Default for Security Reasons in Magento 2:
Go to folder pub/errors find file local.xml.sample
Rename the file local.xml.sample to local.xml in the same folder pub/errors
Also, set developer mode using the following command :
1 |
php bin/magento deploy:mode:set developer |
So, that’s it.
If you still have any doubts, do not hesitate to mention them in the Comments section below. I’d be happy to help.
Feel free to share the solution on social media with fellow developers 😊
Thanks.
Still need help? Hire our Adobe-certified Magento experts.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
24 Comments
I have production mode I face the same issue sometimes, at the time we are not doing the theme and extension side.
Please help
Hey Dinesh,
Please change it to developer mode than you will be able to see the exceptions.
Hi!
I had the same error message on my website and tried your suggestion.
But now I will get only errors on my website.
Hope you can help me that my site will work again.
kindly regards.
Hello Hubert,
It seems like there is an error related to theme.
You can try by checking at the location app/code/Rokanthemes/Themeoption/Observer/RefreshStyleObserver.php 58 line
Moreover, you can try by giving 777 permission to pub/static.
Also check the owner of the file or folder.
Thank You
Hello Sanjay
I’m a totally newbie in magento. I have skills in linux, wordpress, macos but this is the first time I have a client with magento shop and I faced the same issue, once I tried to log in into the admin area. Once I entered user/pass I got the message “There has been an error processing your request. Exception printing is disabled by default for security reasons. Error log record number: 987882184e9b868db9638bdc913510ba0170905862fd2c0de2a3fd22116db31c”
After a little research I came to your website for the solution. I need your help because:
The owner of the website has no clue at all from technology. The previous dev got disappeared – and that’s why I offered to help him.
I have full access to cpanel, hosting provider, everything. But I don’t have a local copy of it – as I see in your example- so to test it here first.
Can you please guide me, to fix this issue, safely and only through cpanel, file manager and etc? SSH is not an option for now but if I must enable it, I can do it.
Please I remind only through web/browser any solution you might have.
Thank you so so much <3
Hello,
Please check in the file of var/log/report folder.
Thank You
hi,
i have a problem. for error i set in backend in store —> store view
i change the code
before:
code: default
after
code: change name
and when i save the site go in error
is it possible set via SSh and change the code?
Hello Andrea,
No, it can not be done using SSH command, you can do it from database directly from ‘store’ table.
Thank You
Hi Sanjay,
When I tried to turn off developer mode, the terminal showing that “jailshell: bin/magento: Permission denied”
Hello,
It is the permission issue.
Please assign the permission to the bin folder and try again.
Thanks.
Thank You for the quick and simple fix – it helped me out a ton. 🙂
I’m glad to be helpful 🙂
Thank you for your appreciation!
Hello Sanjay, after running this command issue has been solved but my site is opening very slow
Hello Meghna,
After your issues are resolved, please switch your store to the production mode.
Thank you.
Dear Sanjay,
Very usefull tip, thank you ! It worked for me.
Question: Once Magento is fully recovered, shall we revert the commands.
Meaning to say, rename the file into local.xml.sample and undo developer mode ?
What is your advise ?
Best regards
Hey!
Thanks for the appreciation and I’m glad the solution was helpful to you.
Now, as far as your question is concerned, yes you need to revert from the developer mode to the production mode.
Thanks.
What is the command to turn off developer mode
Hello Richard,
Take the site in the production mode using the below command:
bin/magento deploy:mode:set production
Thank you.
very helpful,
Thanks!
Hi Sanjay,
How can I do this below? with which programm?
(Also, set developer mode using the following command :
php bin/magento deploy:mode:set developer
1
php bin/magento deploy:mode:set developer)
Kind regards
Dani
Hello Dani,
Check the following:
1. using SSH you can run this command
2. also in c-panel if the terminal is available
Thank you.
Very helpful.
Thank you.
Thank You Pawel, We are Grateful!!
Hello Sanjay,
Unfortunately I’m lacking the skill sets to carry out the “Solution for Exception Printing”. Can you provide other options?