0

I've read a few questions about this issue, but none of the answers were accepted so I'm unsure which answer to apply. I need to be able to log all errors in a log file which can't be read from the outside and prevent errors from being diplayed in the browser.

The language I'm working with is PHP. Maybe showing a 500 Internal Server Error in place of those errors would have been more appropriate.

Thank you.

anna
  • 585
  • 1
  • 6
  • 22
aborted
  • 4,481
  • 14
  • 69
  • 132
  • Showing status 500 is up to your application. When an error is triggered, it depends on the severity. Some errors will stop the execution of your script, while others will not. – machineaddict Mar 13 '14 at 14:02
  • Well warnings and fatal errors would be the ones I'd like to hide from the public. I want them to know as less as possible for vulnerabilities, if any... – aborted Mar 13 '14 at 14:03
  • [The highest voted answer on this question](http://stackoverflow.com/questions/16184881/logs-php-error-but-not-display-it-in-browser) will do what you need. Meanwhile, I'm searching for a more complete one as I know there must be one here. – Michael Berkowski Mar 13 '14 at 14:04
  • I prefer using error reporting in htaccess or user.ini or php.ini, as this is more likely to work as intended. Anyway, check the answer from Michael Berkowski. – machineaddict Mar 13 '14 at 14:06

0 Answers0