View Full Version : (solved) Getting a HTTP 500 error page when there is a php error on a page

11-16-2007, 10:31 PM
I normally use XAMPP when installing Apache, PHP & MySQL. When there is a PHP error on the page it shows the line and the PHP error (which is a good thing).

Here's my problem at work our IT guy did the install (Apache, PHP & MySQL) using the individual installs for each (and I cant get him to use XAMPP). The problem is on this install when I have a PHP error (syntax) I get a 500 error page not a page with the PHP error and line. Any one have an idea where/what I need to change to not get the 500 error page?
I've looked thru the Apache config compared it to the one one my XAMPP install both look about the same as far as the error page settings, done some googling and and can't figure it out.

11-16-2007, 10:40 PM
(and I cant get him to use XAMPP)

If he did, he wouldn't be an IT guy. He'd be a guy that's messing around with a bunch of downloaded scripts. ;)

11-16-2007, 10:47 PM
If he did, he wouldn't be an IT guy. He'd be a guy that's messing around with a bunch of downloaded scripts. ;)

Ok True aedrin, I've gotten lazy in my old age and need to quit taking the easy route and using scripts and get back to doing stuff the right way (yes scripts are good, and I know you need to know whats going on before you use them).

Well I did find the answer It wasn't an Apache config problem it was a PHP Config problem display_errors was turned off in the php.ini file.

11-16-2007, 10:51 PM
By the way, XAMPP has a sort of disclaimer that it is not meant for a production environment because it doesn't have any real security. It is only for development (learning) purposes. apache friends - xampp for windows: A matter of security (A MUST READ!) (http://www.apachefriends.org/en/xampp-windows.html#1221)

11-16-2007, 10:55 PM
Read post #3 in this thread - http://www.codingforums.com/showthread.php?t=127775

PHP 5.2.4 contains a bug in the error reporting clean up code. Either upgrade to php5.2.5 or turn off output_buffering in php.ini or a .htaccess file.

I happened to be the one to report this bug to php.net. Basically, when php stops due to a fatal parse or fatal runtime error, the output buffer is not flushed like it would be when the code runs to normal completion. So, any error output is not sent to the browser.

Edit: Or if you have php 5.2.5 and display errors is off (the default) so that nothing is output to the browser when an error occures, the new default php operation is to cause a code 500 page to be displayed (which is the code that introduced the bug.)