The topic today is one of the popular errors message you will probable face when exploring Magento 2. As if the error message shows “an error has happened during application run. see exception log for details” when you have uploaded Magento CE latest version and want to install it on your server, so what should you do? In this post, we will digging into this common error and solutions to fix it properly.
What is “An error has happened during application run. See exception log for details”
How much Magento is powerful and reliable, sometimes a bit hard too. Magento throws unknown issues and scares the developers. But no need to irritate or annoy. Magento itself helps the developer and support the solutions. The experienced Magento developers or any other person can encounter the most common error when you are working with the Magento 2 platform. The issues which you may encounter can be undeniable little trouble but if you do not try to fix them soon they can become bigger problems for you.
This error has occurred during application run. See exception log for details. Could not write error message to log. Please use developer mode to see the message. This is a common issues that Magento 2 users may face when upgrading Magento 2 version or even after installing a new Magento 2 instance.
Some users said that after failed to upgrade Magento 2 version, they use rollback button to revert version and this error message appear.
Cause of the error
The error message could appear when there’s a problem happening with Magento 2. There are possible causes of this error including
- Missing required PHP extensions
- MySQL service not responding on your server
- Wrong database connection information
- Wrong command when installing Magento 2.4
- Lack of
Each type of error has different solution, in the next part we will learn about all possible cause of this error and how to fix them
How to Fix this error in Magento 2
Either of the following solutions will solve the error in Magento 2.
1. Set Developer Mode
Developer mode is suitable for debugging and development. As we mentioned in the above error, Set Magento 2 developer mode to see the message. To set developer mode,
- Go into Magento 2 root via SSH/CLI
- Use the following command:
php bin/magento deploy:mode:set developer
Also, you ought to check your Magento 2 error folder in Magento root var folder (var/report/*, var/log/debug.log, var/exception.log and system.log)
2. Switch to Developer mode via .htaccess
If you can’t access your Magento 2 root directory via SSH/CLI, you can forcibly switch to developer mode via .htaccess. Here is what you need to do.
- Log in and navigate to the root of your store.
- Open .htaccess file for editing.
- Uncomment the following line (usually line #5):
SetEnv MAGE_MODE developer
3. Flush Cache
To flush Magento 2 cache, move to Magento 2 root directory and use the following command to clear the cache. Try reloading the page when you are completed.
php bin/magento cache:flush
That’s all about the “an error has happened during application run. see exception log for details ” error and how to fix it in Magento 2. If you are a developer and have the knowledge of Magento 2 platform, then you can give a try to handle the issue by your own or you can also take the assistance of a Magento 2 expert. Also, you can also ask that question online in the top communities to have the solutions:
About us: Magesolution is one of the leading Magento 2 extensions & theme providers and web development services in the world. We offer high-quality products and services, specifically eCommerce, Web, and Apps Development that will fix every simple to complex requirement.