To disable PHP error messages from displaying on your website, add this to your .htaccess file:
php_flag display_errors Off
php_flag log_errors On
This hides errors from visitors while still logging them to your error log (viewable in cPanel > Metrics > Errors). On our CloudLinux servers with PHP Selector, you can also toggle display_errors directly in cPanel > Select PHP Version > Options.
For more .htaccess techniques:
This article has been consolidated into our .htaccess guide for easier reference.
