Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

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

1 Answer 1

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

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

 
discard

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.