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.
IN THIS ARTICLE
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
- 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.
- 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.
- Open Options and find display_errors. Set it to Off for production, or temporarily enable it in the controlled test environment.
- Where exposed, check that log_errors is enabled and that the configured log is outside public downloads or otherwise access restricted. Save your changes.
- 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.