A live website should not show its PHP errors to visitors: an error message reveals file paths, table names or pieces of code, which help anyone looking for a weakness. You can hide these messages while still recording them in the PHP error log, where you read them whenever you need to. The two settings are independent and are both made in the Apanel console.
In short: in the domain's Hosting management, Web technologies card, open PHP configuration. Turn off Display php errors, leave PHP error reporting on any choice other than Disabled, then click Save. Repeat for each domain.
Prerequisites
- A domain with web hosting in your Apanel console.
What to know before you start
- When a site is created, the console turns Display php errors on, with the level Only script execution errors. Until you change it, your site's errors are shown in its pages.
- Displaying and recording are two separate settings. Display php errors decides whether the error is written into the page. PHP error reporting decides which errors are reported, on screen as well as in the log.
- On Disabled, PHP reports nothing at all: no display, no line in the log. To keep the log, choose another level.
- Each domain has its own PHP configuration. The setting applies to the domain whose Hosting management you opened, whatever its PHP version, and it is kept if you change version. A subdomain listed on your dashboard has its own Hosting management, and therefore its own setting.
- An application can display its errors itself, through its debug mode (for example
WP_DEBUG in WordPress). The console setting does not override it: turn that mode off in the application too.
How do you hide PHP errors without losing the log?
- Log in to your Apanel console.
- From the dashboard, click your domain name to open Hosting management.
- In the Web technologies card, click PHP configuration.

- In the PHP errors management block, turn off Display php errors.
- Check PHP error reporting: if it is set to Disabled, choose another level (see the table below). Otherwise, leave it as it is.

- Click Save at the bottom of the form. The console confirms with "Operation succeeded".
- Start again from step 2 for each of your other domains.
From now on, when an error occurs, your visitors see a blank page, or a 500 error, instead of the message.
Which level should you choose in PHP error reporting?
The level only changes what goes into the log, since nothing is displayed any more.
| Choice |
What is recorded |
| Only script execution errors |
Fatal errors, warnings and syntax errors. This is the console's starting setting, enough for most sites. |
| All errors, except notices |
More detail, for a site you watch closely. The log grows faster. |
| All errors |
Everything, notices included. Useful during development, often noisy in production. |
| Disabled |
Nothing: avoid it if you want to keep a record of errors. |
How do you read the recorded errors?
- In the domain's Hosting management, Website card, click Log files.
- Open the first tab, which holds the PHP error log. The Content of file (200 lines max) block shows the end of the log, with the most recent entry at the bottom.
Download complete file retrieves the whole log, and Display old files opens the folder of previous logs. To read and understand a specific error, see Display PHP errors to troubleshoot a blank page.
Troubleshooting
| What you see |
What to do |
| Errors are still displayed in the page |
Check that you changed the right domain, and that the application does not have its own debug mode turned on. |
| The PHP error log stays empty although the site has errors |
PHP error reporting is probably set to Disabled: choose Only script execution errors and save. |
| "An error occurred during the operation. Error code: …" after Save |
The configuration could not be applied. Note the code and send it to our support with your domain name. |
Further reading