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

Getting a 500 error, probably caused by an error in my PHP script. For some reason when I have an error it doesn't output it, it just sends me a 500 error. How can I change that?

share|improve this question

The error is going into your log file, but not printed to the server error displayed. This is intentional, because it prevents possibly-sensitive information from being exposed to attackers. (Pathname information, database schemas, possibly something exploitable about the bug that caused the error itself....)

You can either just look at the php error log (probably near wherever your system puts its web server logs), or else you can edit /etc/php.ini to read display_errors = On instead of Off. Unless this is a protected development system, I suggest the former.

share|improve this answer
I did that already, it's still not displaying them. – Rob Nov 24 '10 at 20:21
In that case, can you provide a whole lot more information, please? What's your OS and web server, what PHP version, what you see in the error logs, what other things you've tried.... – mattdm Nov 24 '10 at 21:14
Server version: Apache/2.0.63 CentOS release 5.5 (Final) PHP 5.2.9 – Rob Nov 24 '10 at 22:42
What do you see in the httpd error log? (Usually /var/log/httpd/error_log) – mattdm Nov 24 '10 at 22:47
It's been so long since I ran the default config that I forget, but I think you should at least see some startup/shutdown messages in there. That suggests your host is configured to log elsewhere. – mattdm Nov 24 '10 at 22:56

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.