Error Reporting in Joomla

You might have seen the “Error Reporting” field in your Joomla Configuration Settings, and you might have wondered what it is. In short, the “Error Reporting” field is responsible for controlling the display of errors on your Joomla website. In this post, we’ll discuss what should be the default error reporting on your website, when to change the error reporting level, and what does each and every error reporting level mean (and do).

What should be the default error reporting on your Joomla website?

On any production Joomla website, the error reporting that should be used is “None”. This means that no errors are displayed on your website, regardless of the default settings on your hosting account. Preventing errors from being displayed on your production Joomla website is critical for the security of your website. This is because errors displayed can reveal some critical information about your website, including, but not limited to: the absolute path of your website (such as /var/hosts/youraccountname/public_html/yourjoomlawebsite), MySQL queries sent to your database server (revealing part of your database structure), the type of extensions you’re installing, etc… Some errors might reveal very critical information such as the database username and the database password. When Joomla is first installed, its default error reporting is “System Default”, this means that any error reporting in the global (or local) php.ini file will be inherited by your Joomla application. So, if the error reporting in the php.ini file is E_ALL, then the error reporting on your Joomla website will be E_ALL (which means that all the errors will be displayed to your visitors) – needless to say, the first thing that you need to do when you make your Joomla website live is changing the error reporting to “None”.

When to change the error reporting?

The error reporting should be changed from “None” to anything else only when you are seeing a blank page on your website and/or you are debugging your website. When doing so, we recommend that you create a condition in the index.php file to show the website’s content only for your IP (visitors to your website should see a blank page). This will ensure that only you will be able to see the errors on your website. Once you see the errors on your website, you should fix them, and then change the error reporting back to “None”.

What does each and every reporting mean?

Here are all the error levels on Joomla, along with a description:

  • None: All errors are suppressed. When you set the error reporting to “None”, then no errors are shown whatsoever on the website – except when 3rd party extensions override the Joomla error reporting settings with their own settings.
  • System Default: Joomla will inherit the error reporting from your php.ini. So, if php.ini‘s error_reporting variable is set to E_ALL and the display_errors variable (in php.ini) is set to 1, then Joomla will display all the errors on your website (not good!).

  • Simple: Joomla will display only the warnings and the fatal errors on the website (regardless of what the error reporting level in the php.ini file is). Basically all errors will be displayed with the exception of the notices.

  • Maximum: Joomla will display all the errors, warnings, notices, deprecated functions calls, and strict standards on the website (again, Joomla will ignore the settings in the php.ini file). Note that when you display the notices/deprecated function call/strict standards you may break pages that were already working before.

Addendum: How to manually change the error reporting in the configuration.php file

Sometimes, it’s more fun/convenient/expedient/practical to change the error reporting in Joomla’s configuration.php file directly (without using the interface). This will allow the administrator to have a more granular control over the level of errors that s/he wants to see on the website.

The important thing to remember here is that the value of the $error_reporting in the configuration.php file is the numerical value of PHP’s error constants (such as E_ALL, E_WARNING, E_NOTICE, etc…). See the below:

$error_reporting PHP equivalent Errors displayed on the website
32767 E_ALL | E_STRICT All errors, warnings, notices, and strict standards
30719 E_ALL All errors, warnings, notices
30711 E_ALL & ~E_NOTICE All errors, warnings, but no notices
30711 E_ALL & ~(E_NOTICE|E_WARNING) All Errors. No warnings or notices.
-1 0 No error reporting at all.

Note: Some PHP versions differ in how error constants are evaluated. For example, for PHP versions that are >= 5.4.0, E_STRICT is part of E_ALL. If you want to know the actual $error_reporting value for your environment, it’s better to create a test.php file where you echo the value of your error reporting (for example: echo(E_ALL);), upload it to the server, and see what it prints.

If you’re having problems with your Joomla website and you need help, then all you need to do is to contact us. We’re very helpful, we’re always available, we’re very experienced in PHP and in Joomla, and we’re very friendly. Our services are reasonably priced too! What more could you want?

12 Responses to “Error Reporting in Joomla”
  1. Pingback by How to Debug Joomla? | itoctopus — July 30, 2012 @ 11:28 am

    […] your Joomla website. (If you see a blank page then make sure you enable error reporting – see here for a full guide on error reporting in […]

  2. Pingback by Undefined Index Notice in Joomla Websites: How to Remove | itoctopus — September 23, 2012 @ 1:16 am

    […] Note that you can also do the above in the configuration.php file directly – by setting the value of $error_reporting to “None” or to -1 for older Joomla versions – see this post on Error Reporting in Joomla. […]

  3. Pingback by How to Fix the “Assigning the return value of new by reference is deprecated” Notice in Joomla | itoctopus — November 13, 2012 @ 5:00 am

    […] enabled error reporting and we saw the following two […]

  4. Pingback by “Notice: Undefined property: [extension_name]::$_state” Error in Joomla | itoctopus — February 18, 2013 @ 8:30 pm

    […] working on a major project on a Joomla website, we usually maximize the Joomla error reporting. This guarantees that not a single error, not even a notice, can go undetected and unfixed in our […]

  5. Comment by George — May 26, 2014 @ 6:44 pm

    I’ve turned off the error reporting in the backend of my joomla site but still the error log in my cpanel is still showing and accumulates really fast taking away lots of space. Is it possible that my hosting company overrides my setting? I’ve looked at my system info under php information but the display_errors is turned off. I don’t understand why it’s still showing on my cpanel and taking way lots of space. Any help would be great.

  6. Comment by Fadi — May 28, 2014 @ 3:11 am

    Turning off error reporting in Joomla has nothing to do with your error logs in your cPanel – it just means that errors won’t be displayed on your Joomla site.

    Try adding the following lines to your .user.ini file:

    display_error = off
    log_errors = off

    If it doesn’t work, then please contact your host.

  7. Comment by George — May 29, 2014 @ 3:07 pm

    Thanks a lot Fadi it worked. I haven’t had any problem with it until recently, they had an update. With years I’ve been exposed to this line of work I really still have a lot to learn.:)

  8. Comment by Andsmith — July 7, 2014 @ 7:06 am

    Hello Fadi, I have the same problem. Lots of error logs. Where can I find the .user.ini file that you mentioned? Thank you.

  9. Comment by Fadi — July 7, 2014 @ 7:32 am

    Hi Andsmith,

    You should create that file under the root directory of your Joomla website (e.g. at the same level of your index.php file).

  10. Comment by Andsmith — July 7, 2014 @ 8:27 am

    Hello Fadi, Should it be .user.ini ? or user.ini without dot? Thank you.

  11. Comment by Donald Lareau — March 30, 2017 @ 10:52 am

    I have upgraded a site to Joomla 3.6.5 which has a custom component that was working fine in Joomla 2.5 – Now I am getting SQL errors even when error reporting is set to None.

    Thank you for any hints you might be able to provide.

  12. Comment by Fadi — April 5, 2017 @ 9:30 pm

    Hi Donald,

    This might be caused by a plugin that overrides the Joomla error reporting. If you can post the error here, then we’ll be able to help a bit more!

Leave a comment