Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow safe use of PHP-Error in production env. by handling display_errors properly #59

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

panrafal
Copy link

@panrafal panrafal commented Feb 3, 2013

If display_errors is false, error handling will work normally, but no broken output or error message will be displayed. The page will have 500 status code.

Additionaly, you can provide "error_page" option, with an user-friendly html or php file to print in case of an error.

This way you get across environments:

  • consistent error handling and logging
  • error messages on development
  • pretty error pages on production - whatever happens
  • 500 status, so it won't be taken up by search engines, or AJAX requests

php_error will still catch all errors, but will not print them if display_errors is disabled. 
the same applies to ajax debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant