Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    5
    Thanked 0 Times in 0 Posts

    (solved) Getting a HTTP 500 error page when there is a php error on a page

    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.
    Last edited by JimM; 11-16-2007 at 09:49 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    (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.

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aedrin View Post
    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.

  • #4
    Regular Coder
    Join Date
    Mar 2005
    Location
    D0u$h!t3 k4?
    Posts
    512
    Thanks
    2
    Thanked 5 Times in 5 Posts
    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!)
    Last edited by rpgfan3233; 11-16-2007 at 09:54 PM. Reason: Added link
    PHP Code:
    $hello file_get_contents('hello.txt'); echo $hello
    hello

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,079
    Thanks
    2
    Thanked 320 Times in 312 Posts
    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.)
    Last edited by CFMaBiSmAd; 11-16-2007 at 10:01 PM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •