500 error - logged in only

archshrk
archshrk's picture

Joined: 2005-04-29
Posts: 45
Posted: Tue, 2008-01-22 19:17

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.

-
www.archshrk.com
www.photojulia.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2008-01-22 21:08

Most likly a memory issue:
FAQ: I get only a blank screen when trying to view my Gallery, what's wrong?
both applications WP and G2 have to load the data required.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
archshrk
archshrk's picture

Joined: 2005-04-29
Posts: 45
Posted: Tue, 2008-01-22 21:41

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.

-
www.archshrk.com
www.photojulia.com

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2008-01-22 23:35

Archshrk,

Not sure if a 500 error would be memory based or not.. Your error_log should have some more detail, have you check..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
archshrk
archshrk's picture

Joined: 2005-04-29
Posts: 45
Posted: Tue, 2008-01-22 23:56

Unfortunately, 1and1 doesn't make accessing error logs easy (if at all)
So long as visitors have no problem, then I can live with it.
-
www.archshrk.com
www.photojulia.com

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2008-01-23 04:44

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..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
archshrk
archshrk's picture

Joined: 2005-04-29
Posts: 45
Posted: Wed, 2008-01-23 16:01

according to 1and1...

Quote:
Since we don't provide access to Apache error logs on shared hosting packages for
technical reasons, you can create your own error logs for debugging PHP Scripts.

Please insert the following code in your PHP script (or create separate file and
and add the code in it. Include the file using "include()")

[Code ommitted for clarity]

Problem is, I'm not sure how to do this. Where would I put the debugging code?
-
www.archshrk.com
www.photojulia.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-01-23 18:58

[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

_____________________________________________
Blog & G2 || floridave - Gallery Team

Quote:
 
archshrk
archshrk's picture

Joined: 2005-04-29
Posts: 45
Posted: Wed, 2008-01-23 19:19
   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");
      } 
   }

-
www.archshrk.com
www.photojulia.com

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2008-01-23 21:54

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..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo