How can you prevent the display of PHP errors on a production website while still logging them?
- Set display_errors to Off in PHP configuration
- Use error_reporting(E_ALL) to suppress error display, while configuring a custom error handler for logging
- Enable error_reporting(E_ALL) to display errors only for the admin
- Use PHP's debug_backtrace() to hide errors from public view, while logging them
To prevent the display of PHP errors on a production website while logging them, you should configure a custom error handler to log errors and set display_errors to Off in the PHP configuration.
Loading...
Related Quiz
- A static method in PHP OOP is a method that belongs to the class itself rather than an instance of the class.
- The elseif statement in PHP is used to specify a new condition to test if the first condition is ______.
- Superglobals in PHP are ________ arrays, meaning they can be accessed regardless of the scope.
- You have a PHP script and you need to call a static method. How would you do this?
- PHP uses the global keyword to make a local variable have global scope.