0

Is there anyway to disable absolute path which appears with php errors.

i.e.

/domain.com/www/user/html/index.php on line 179

I don't want php to show "/domain.com/www/user/html". Only the file name should appear with line number.

User4283
  • 781
  • 3
  • 10
  • 25

1 Answers1

2

You could setup a custom error handler to format the messages the way you want. If it's a production box, you probably should not have display_errors on. Use the reporting log files instead.

http://php.net/manual/en/function.set-error-handler.php

MacAnthony
  • 203
  • 1
  • 3
  • 10
  • Note also that if you have errors suppressed you still can view errors in the error log file (you can change the location of that file, too). – Alberto Martinez Nov 23 '10 at 20:17
  • Yes, excellent point. Reporting errors and displaying errors are 2 separate directives. – MacAnthony Nov 23 '10 at 20:53
  • I'd have given this +1 if you hadn't suggesting suppressing errors - only the (on-screen) reporting should be suppressed! – symcbean Nov 24 '10 at 15:04
  • I did mean the display errors. I didn't mean turn off error reporting. I should have been more clear. – MacAnthony Nov 24 '10 at 16:42