500 internal server error instead of php error
home > Web Development > 500 internal server error instead of php error
I found many users having the same problem and unfortunately not all found the solution
Well, I found the solution in my case and I wanted to share.
With a new server, I had some php pages showing Server Error:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
This happen when my PHP script was actually supposed to display some syntax errors or other php errors, but the server was configured with display_errors = Off, so I needed to edit php.ini and change to
display_errors = On
This fixed the problem, even though I tried many things before this. Note that just setting the parameter error_reporting = E_ALL didn’t fix this, it was the display_errors parameter.
The 500 internal server error in this case is a bit confusing and it only happen in Google Chrome browser, in Mozilla Firefox 5 it just shown a blank page which it would have been more helpful instead of making me think something is configured incorrectly on the server (which is what most people would say).
Tip: for some other users the problem was missing php.ini file in certain directories.
Tags: 500, error, internal, php, server