What are the potential risks of displaying errors to users during development?

Displaying errors to users during development can expose sensitive information about the application, such as database credentials or file paths, which can be exploited by malicious users. To prevent this, errors should be logged internally for developers to review and address without exposing them to the end users.

// Set error reporting to log errors internally
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', '/path/to/error.log');