Configuring PHP error display and logging with CloudLinux in DirectAdmin

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 DirectAdmin, open the appropriate user account and domain, then search for Select PHP Version. In Evolution it may appear under Extra Features. Open the CloudLinux selector, not an unrelated server administration page.
  2. Check the active PHP version and which websites the selector change will affect. DirectAdmin can expose both its native PHP selection and CloudLinux PHP Selector. The selected domain in DirectAdmin does not by itself prove that an Alt-PHP change is isolated to that domain. Check the selector scope before applying an account-wide change.
  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.

  • 0 Users Found This Useful
  • control-panels, development
Was this answer helpful?

Related Articles

Changing the PHP version with CloudLinux in DirectAdmin

A PHP version change can make an application compatible with current dependencies and security...

Managing PHP extensions with CloudLinux in DirectAdmin

Extensions add capabilities such as database access, multibyte text handling, image processing...

Configuring allow_url_fopen with CloudLinux in DirectAdmin

allow_url_fopen controls whether PHP file functions can use supported URL wrappers, such as...

Adjusting the PHP memory limit with CloudLinux in DirectAdmin

memory_limit limits memory available to an individual PHP script. Increasing it can help a...

Changing the PHP post_max_size limit with CloudLinux in DirectAdmin

post_max_size limits the size of the entire HTTP POST body received by PHP. It includes...