Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Show Detailed Error Messages on Your Website

This guide shows how to turn on full error details, so you can find out why a page is failing.

Web Hosting2 min read13 steps3 screenshots

Why are errors hidden?

By default, many sites show only a plain message such as "500 Internal Server Error". This is on purpose. Long error text can show private paths and settings to strangers. But when you are fixing a problem, you need the details. Turn them on, find the cause, and then turn them off again.

Warning: Never leave detailed errors on for a live site. Visitors and hackers could read them. Back up any file before you edit it.

For PHP sites

PHP is the language behind WordPress and many other sites.

Method 1: Use the .htaccess file

  1. Open your file manager or an FTP program.
  2. Turn on hidden files, since the name starts with a dot.
  3. Open .htaccess in your site folder, often public_html.
  4. Add these lines at the top:
php_flag display_errors On
php_value error_reporting E_ALL

This tells PHP to show every error on screen. This only works on some setups. If you get a 500 error after adding them, remove them.

Access inetmgr
  1. Save the file and reload your page.

Method 2: Use a PHP file

  1. Open the page's PHP file.
  2. Add these lines at the very top, after <?php:
ini_set('display_errors', 1);
error_reporting(E_ALL);

These two lines switch error display on for that script only.

Access Error Pages

Method 3: WordPress

  1. Open wp-config.php.
  2. Find the line define('WP_DEBUG', false);.
  3. Change false to true.
  4. Save and reload.

To write errors to a log file instead of the screen, also add define('WP_DEBUG_LOG', true);. The log appears in wp-content/debug.log.

Using the control panel

Some panels have a PHP settings page. Look for MultiPHP INI Editor or Select PHP Version. Find the display_errors option and switch it on.

Check the error log

Servers also keep an error log. Look for Errors or Logs in your control panel. It lists problems with times and file names.

Turn it off after

  1. Remove the lines you added, or set the value back.
  2. Reload your page to confirm the errors are hidden.
    Detailed Error Pages

Need help reading an error? Open a support ticket with the text.

Quick recap

  • Errors are hidden to protect your site.
  • Show them temporarily with .htaccess, PHP code or WP_DEBUG.
  • Check the error log too.
  • Turn the details off when done.