Is it advisable to have display_errors set to FALSE on production systems?
It is generally not advisable to have display_errors set to TRUE on production systems as it can potentially expose sensitive information about your code to users. It is recommended to log errors instead and display a generic error message to users. This can be achieved by setting display_errors to FALSE and configuring error logging.
// Set display_errors to FALSE
ini_set('display_errors', 0);
// Set error logging to a file
ini_set('log_errors', 1);
ini_set('error_log', '/path/to/error.log');
Related Questions
- How can output buffering be used in PHP to prevent header modification issues when redirecting users to a new page after successful login?
- How can one upload an entire folder with multiple files at once using PHP?
- What are the best practices for handling multiple occurrences of a specified pattern in a text using PHP?