Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


/ on line 179

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

share|improve this question
Can you detail why? I don't think this is a good idea – Rob Olmos Nov 23 '10 at 18:30

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.

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.