How do I hide PHP errors from visitors while keeping them in a log for troubleshooting?

هذا المحتوى متوفر باللغتين الرومانية والإنجليزية فقط؛ يظهر النص الإنجليزي أدناه.

How do I hide PHP errors from visitors while keeping them in a log for troubleshooting?

On a public website, error messages can reveal file paths or other technical details. Check the PHP settings available for your site: display_errors controls whether errors are displayed, while log_errors controls whether they are logged. The configuration method depends on the hosting environment; you may not be able to change every directive yourself.

Store the log somewhere that is not publicly accessible and check whether your application has its own debugging options. In WordPress, these can affect error display and logging. After making changes, verify logging in a test environment. Restrict access to logs, avoid recording passwords or personal data, and set a retention period.

أسئلة ذات صلة

إليك بعض الأسئلة التي قد تهمك إجاباتها. نجيب عن الأسئلة المهمة والعملية لعملائنا.

اشترك في النشرة الإخبارية

اشترك في النشرة الإخبارية. لا نستخدمها إلا للمعلومات المهمة.

رسم توضيحي للاشتراك في النشرة الإخبارية