Understanding the Exception‑Email Feature
When the exception‑handler runs, it means the site is already in a critical state – the database may be unreachable, disk space could be exhausted, external connectivity might be down, PHP memory may be depleted, or the host operating system could be terminating processes. Because of this, the code that powers the feature is pre‑loaded; it cannot rely on loading additional files or resources at the moment it fires.
What does the feature do?
It sends an email whenever a PHP exception occurs. These same exceptions are also written to your server’s error log (or PHP error log). You might wonder why you would need an email if the information is already in the logs. The answer is that, for particularly obscure exceptions, the email can include a full environment dump – details that are not present in the log – helping you to understand exactly what is happening.
When should you enable it?
Only when you are chasing a rare, hard‑to‑reproduce exception and you need that extra context to diagnose the problem. In those cases, the additional information can be invaluable.
Why it is not suitable for your current situation
Your error log shows a PHP exception stating that Joomla cannot connect to the database because the maximum number of database connections has been exceeded. This is a clear sign that the server is being overwhelmed with requests. Enabling the exception‑email feature in this scenario would cause the server to generate a large volume of emails on top of the already heavy load, effectively DoS‑ing yourself.
Recommended action
- Disable the exception‑email feature – it is not required for troubleshooting the “too many connections” issue and will only add unnecessary strain.
- Use the standard error logs to investigate the overload; consider implementing request throttling, checking for runaway scripts, or reviewing your server’s connection limits.
- If you later encounter an unusual exception that the logs do not explain, you can re‑enable the feature temporarily to capture the detailed dump, then disable it again once the issue is resolved.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!