You are developing a PHP web application and want to ensure that any PHP errors do not reveal sensitive information to the users. Which approach would you take?

  • a) Disable error reporting.
  • b) Enable error reporting and use custom error handlers.
  • c) Use generic error messages for all errors.
  • d) Store errors in a public log file.
b) Enabling error reporting and using custom error handlers is the recommended approach. It allows you to handle errors gracefully while not revealing sensitive information to users. Disabling error reporting (a) could make debugging difficult, using generic error messages (c) isn't best practice, and storing errors in a public log file (d) is a security risk.
Add your answer
Loading...

Leave a comment

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