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?
1 Answer
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.
-
-
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....– mattdmNov 24, 2010 at 21:14
-
-
1What do you see in the httpd error log? (Usually
/var/log/httpd/error_log
)– mattdmNov 24, 2010 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.– mattdmNov 24, 2010 at 22:56