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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    478
    Thanks
    7
    Thanked 3 Times in 3 Posts

    how do i get the page that caused the internet server error 500

    I have been told by a few people that my site is showing every now and then the internal server 500 error page.

    I have checked the logs and access-logs and errors page in cpanel but can not seem to find anything wrong with the site.

    I do have a script in my footer of all pages that stores and emails every error that is found once the page is almost completely finished being setup before it is sent to the browser. But this does not show anything that answers what the 500 error actually is.

    How else can I get these internal server errors so I can find out if it is a local (user) problem or if it is something that is wrong with my code.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    500 would be caused by a cgi error on the web server. You cannot intercept this inline of your PHP code. If its not regular and cannot be replicated, than chances are that its not your PHP code causing it. If you can get specific information including querystring or post input and can then use that to replicate it, that would likely be caused by your code.

    This is also not a PHP specific error. 500 is the end all when no other error fits. So effectively its *any* error that has occurred on the webserver. You need to check the error logs for the httpd (and I haven't a clue if cpanel gives you those) in order to determine a cause.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by needsomehelp View Post
    How else can I get these internal server errors so I can find out if it is a local (user) problem or if it is something that is wrong with my code.
    If you have a Google Webmaster Tools account or Bung Webmaster Tools account then any errors either of those two search engines receive when spidering your site will be logged in that account. That will give you at least a partial list of any 500 errors that have occurred for your site. Once you see that ALL of your pages gave a 500 error at the same time but that any you try to access now don't give the error you will be able to confirm that it was a temporary glitch with the server that had nothing to do with your site.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Regular Coder
    Join Date
    Oct 2009
    Posts
    478
    Thanks
    7
    Thanked 3 Times in 3 Posts
    ok I shall keep trying to figure this one out.

    thanks


  •  

    Posting Permissions

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