500 error - logged in only
archshrk
![]()
Joined: 2005-04-29
Posts: 45 |
![]() |
When logged in to my site, I often get a 500 error message on my WPG2 pages. Visitors do not. This does not occur in the stand alone gallery and there are no problems with sidebar images or inserted images. Now I have 1and1 hosting so I can't access my error logs but I thought I'd put it out there for discussion. |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
Most likly a memory issue: Dave _____________________________________________ |
|
archshrk
![]()
Joined: 2005-04-29
Posts: 45 |
![]() |
Yeah, that's what I was thinking. My memory limits are set above the requirements but the other data (sidebar) may be putting too much of a load on the the ol' servers. I may remove the sidebars and see if that helps. |
|
ozgreg
![]()
Joined: 2003-10-18
Posts: 1378 |
![]() |
Archshrk, Not sure if a 500 error would be memory based or not.. Your error_log should have some more detail, have you check.. ____________________________________ |
|
archshrk
![]()
Joined: 2005-04-29
Posts: 45 |
![]() |
Unfortunately, 1and1 doesn't make accessing error logs easy (if at all) |
|
ozgreg
![]()
Joined: 2003-10-18
Posts: 1378 |
![]() |
Bloody heck mate, get rid of 1&1 when the account is due next.. I cannot believe you cannot even see your error_log how in the heck are you meant to work out site errors.. ____________________________________ |
|
archshrk
![]()
Joined: 2005-04-29
Posts: 45 |
![]() |
according to 1and1... Quote:
Since we don't provide access to Apache error logs on shared hosting packages for Problem is, I'm not sure how to do this. Where would I put the debugging code? |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
[Code ommitted for clarity] Can you attach it please. I would try to add it to main.php depending on what it looks like. Dave _____________________________________________ Quote:
|
|
archshrk
![]()
Joined: 2005-04-29
Posts: 45 |
![]() |
error_reporting(0); $old_error_handler = set_error_handler("userErrorHandler"); function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) { $time=date("d M Y H:i:s"); // Get the error type from the error number $errortype = array (1 => "Error", 2 => "Warning", 4 => "Parsing Error", 8 => "Notice", 16 => "Core Error", 32 => "Core Warning", 64 => "Compile Error", 128 => "Compile Warning", 256 => "User Error", 512 => "User Warning", 1024 => "User Notice"); $errlevel=$errortype[$errno]; //Write error to log file (CSV format) $errfile=fopen("errors.csv","a"); fputs($errfile,"\"$time\",\"$filename: $linenum\",\"($errlevel) $errmsg\"\r\n"); fclose($errfile); if($errno!=2 && $errno!=8) { //Terminate script if fatal error die("A fatal error has occurred. Script execution has been aborted"); } } |
|
ozgreg
![]()
Joined: 2003-10-18
Posts: 1378 |
![]() |
This is just a little nicer way of spitting out php errors and I am not sure if the 500 errors will be trapped by this piece of code and I also have a feeling WP turns off error reporting as well.. ____________________________________ |
|