Apache Custom Error Page mod_php

Discussion in 'Apache' started by 0ron124, Jul 27, 2011.

  1. #1
    Hi Guys,

    I recently setup a custom server with Opensuse Linux and Apache2 with mod_php. All is running great except I would like to create a custom error page which I have written in php. I have written this page and made it accessible and tested it using 404 and 403 errors. However, when I make a simple php page to produce a 500 error I am not redirected to the error page instead Google Chrome displays a generic 500 error message same with Firefox. Oddly enough, I am directed to the error page when executing a bad perl script via CGI.

    In httpd.conf I have added this line same as my 404 error page

    ErrorDocument 404 /error.php
    ErrorDocument 500 /error.php

    Anyone have any idea what I wrong?
     
    0ron124, Jul 27, 2011 IP
  2. helpinghost

    helpinghost Active Member

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #2
    Are you sure you are not looking at the so called "friendly error message" of the Browser.
    I'm unsure about Chrome, but this is how to disable it in FF:

    Type in de addressbar: about:config.
    In the filterbar type: error and press enter.
    Now set the value of the ‘browser.xul.error_pages.enabled‘ to ‘true‘.
    Restart Firefox.
     
    helpinghost, Jul 28, 2011 IP
  3. 0ron124

    0ron124 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nope, I am infact looking at apache's error message which is not being sent. Here's a URL that you can test the 500 error live. I've also provided a 404 URL test.

    hxxp://webapp.riverspringscharter.org/fail
    hxxp://webapp.riverspringscharter.org/test.php
     
    0ron124, Jul 28, 2011 IP