Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-13-2013, 04:56 PM   PM User | #1
needsomehelp
Regular Coder

 
Join Date: Oct 2009
Posts: 302
Thanks: 4
Thanked 3 Times in 3 Posts
needsomehelp can only hope to improve
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.
needsomehelp is offline   Reply With Quote
Old 02-13-2013, 05:01 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 02-13-2013, 08:52 PM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,451
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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/
felgall is offline   Reply With Quote
Old 02-14-2013, 10:15 AM   PM User | #4
needsomehelp
Regular Coder

 
Join Date: Oct 2009
Posts: 302
Thanks: 4
Thanked 3 Times in 3 Posts
needsomehelp can only hope to improve
ok I shall keep trying to figure this one out.

thanks
needsomehelp is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:08 PM.


Advertisement
Log in to turn off these ads.