How to hide PHP errors on your website Print

  • 0

PHP error messages are useful while developing but shouldn't be shown to visitors on a live site, as they can reveal file paths and other details.

Option 1: MultiPHP INI Editor (recommended)

  1. In cPanel, open MultiPHP INI Editor in the Software section.
  2. Choose your domain.
  3. Set display_errors to Disabled and click Apply.

Option 2: .htaccess

Add this to the .htaccess file in your site's folder:

php_flag display_errors off

If this gives a 500 error, remove the line and use Option 1 instead.

Still need to see errors?

Errors are still written to your error log (see How to find error log files in cPanel), so you can turn them off for visitors and keep troubleshooting.


Was this answer helpful?

« Back