Bobcares

Moodle PHP display_errors | About

by | Dec 2, 2023

Learn more about Moodle PHP display_errors. Our Moodle Support team is here to help you with your questions and concerns.

Moodle PHP display_errors | About

Error reporting plays a key role in maintaining the stability and security of Moodle. Today we are going to take a look at how to handle display_errors configuration in different environments, from development to production.

Moodle PHP display_errors | About

 

  1. Display Errors in Development:

    During the development phase, the errors displayed on the screen helps identify the issue. To activate the error display, we can set `display_errors` to `On` in our PHP configuration.

    For Moodle, we can find the `php.ini` file and make sure it includes the line:

    display_errors = On

  2. Display Errors in Moodle’s Configuration:

    Moodle has its own configuration file. This is where we will find error reporting settings. We have to look for a line similar to the following:

    $CFG->debug = E_ALL | E_STRICT; // debugging messages enabled
    $CFG->debugdisplay = true; // display the debug messages

    Hence, by setting `$CFG->debugdisplay` to `true` we enable Moodle to display debug information, including PHP errors, on the screen.

  3. Logging Errors:

    In a production environment, it is a good idea to not display errors directly to users for security reasons. Instead, errors should be logged. Moodle offers a logging system that can be configured to capture and store error information. In our `config.php` file, we will run into a setting like this:

    $CFG->debug = E_NONE;

    Hence, by setting `$CFG->debug` to `E_NONE` we can turn off debugging and error display. Instead, errors will be logged in Moodle’s log files.

In other words, effectively managing error reporting in Moodle is useful for both development and production environments. So, by understanding and configuring the `display_errors` setting, we can ensure a secure and efficient learning management system.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

At the end of the day, our Support Experts introduced us to Moodle PHP display_errors.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.