Skip to content

Knowledgebase

Configuring PHP error display and logging with CloudLinux in cPanel

cpanel-whm, development

PHP errors are useful for diagnosis, but displaying them on a public site can expose filesystem paths and application details. For a production website, keep public error display off and investigate the error log. Temporary display is most appropriate in a restricted development environment.

Check access and requirements

Record the time and URL of the failure and locate the account's error log. If a test requires visible errors, use staging or an access-restricted copy and avoid processing live customer information there.

01 Change the setting

  1. In cPanel, search for Select PHP Version and open the CloudLinux tool. It is commonly listed under Software. Select the intended domain if your installation displays a domain selector.
  2. Check the active PHP version and which websites the selector change will affect. cPanel may also offer MultiPHP Manager and MultiPHP INI Editor. These tools manage a different PHP configuration path. Identify whether the domain uses CloudLinux Alt-PHP or a native EasyApache PHP handler before editing.
  3. Open Options and find display_errors. Set it to Off for production, or temporarily enable it in the controlled test environment.
  4. Where exposed, check that log_errors is enabled and that the configured log is outside public downloads or otherwise access restricted. Save your changes.
  5. Reproduce the fault once and read the newest matching log entry. Fix the identified cause, then keep public display disabled when returning the site to normal operation.

Confirm the expected result

Visit the affected page as a signed-out visitor and confirm that it no longer exposes a stack trace or server path. Verify that a reproducible test error is still recorded in the intended log so that disabling display does not remove your ability to diagnose problems.

Why can errors still appear, or fail to reach the log, after I change these settings?

Application debug modes can control their own output independently of PHP. Check the CMS or framework's production/debug configuration too. If nothing reaches the selected log, the website may use another PHP handler or a different log location. Share a redacted error excerpt with support.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support

Powered by WHMCompleteSolution