Detailed error messages help you find the cause of a fault on your website. The steps depend on the language your site uses. Check this first, then follow the section that matches your site.
Check which language your site uses
A web.config file only controls error messages for sites built with ASP.NET (a Microsoft web framework). Most sites on Linux hosting use PHP instead. If your site uses PHP, use the PHP steps below. If you are not sure, ask the person who built the site, or look in File Manager in the client area at https://my.hostking.host for a web.config file.
Show errors for a PHP site
cPanel
- Log in to cPanel from the client area at https://my.hostking.host.
- Under Software, click MultiPHP INI Editor.
- Select Basic Mode.
- Choose your domain from the dropdown list.
- Find
display_errorsand set it to On. - Click Apply.
- To show all warnings and notices, set
error_reportingto E_ALL on the same screen, then click Apply again.
PHP settings apply to one PHP version at a time. Check which version your site uses in MultiPHP Manager, then make the change for that version.
DirectAdmin
- Log in to DirectAdmin from the client area at https://my.hostking.host.
- Look for PHP settings for your domain.
- Set
display_errorsto On anderror_reportingto E_ALL. - Save the change.
If you cannot find these settings, contact support using live chat or a support ticket from the client area. Support can confirm the correct steps for your account.
Show errors for an ASP.NET site
Only use this section if your site runs on ASP.NET. ASP.NET is uncommon on Linux hosting.
Warning: Detailed errors can show sensitive information, such as stack traces and file paths. Turn them on only when you have no other option, and turn them off again afterwards.
- Back up your
web.configfile before you change it. - Open your
web.configfile. - Inside the
<system.web>section, find or add<customErrors>. - Set the
modeattribute to Off. - Save the file and test your site.
Do not replace your whole web.config file with a sample. Change only the setting you need.
Turn detailed errors off again
Once you have fixed the problem, repeat the steps above and change the setting back. For PHP, set display_errors to Off. For ASP.NET, set mode back to its previous value.
On a live site, it is safer to hide errors from visitors and write them to a log instead. Ask support about error logging for your account.
Troubleshooting
The error message still does not appear
- Check that you changed the PHP version the site uses.
- Clear your browser cache, then reload the page.
- Check whether your site's software or a plugin hides errors. Some scripts suppress or redirect error output regardless of your settings.
The site stops working after the change
- Restore the backup of your
web.configfile, if you changed it. - Set the PHP setting back to its previous value.
- Contact support from live chat or a support ticket in the client area.
