On Friday 08 September 2006 01:22, Robert Cummings wrote:

> > > Binary search using error_log() and __LINE__ output to track down where
> > > the thing dies.
> >
> > Binary search?  I must be using a different definition than you are,
> > since I don't know what a binary search would do for me when trying to
> > track down a problem with output. :-)
>
> Binary search to track down a problem with output means you place log
> info at three points in the code, 2 that you are certain lie outside the
> error condition, and the 3rd to cut the problem space in two. Then
> depending on what gets output you know in which half of the problem
> space the error exists. Then you take again divide the problem space
> until you find the exact location of the bug.
>
> > I suppose it is possible that it's dying at some point other than where
> > the output is stopping.  I've localized where the output stops; it's
> > always at the end of a given loop iteration in the code that generates
> > the sidebar; at the end of the loop that passes the 4 KB mark, it seems.
>
> I didn't realize you had already tracked down the location. Have you
> tried displaying errors? If you're worried about a production site you
> could install a custom error handler that displays the error based on
> the REMOTE_ADDR value. That won't help you though if a segfault is
> occurring. Are the PHP versions the same between machines?

What I did was along the lines of:

print "<pre style='display:none">Got here</pre>\n";

That way I could see it by looking at the code, but normal people visiting any 
other page on the site wouldn't notice a difference.  That's how I was able 
to determine that it was output size-based.  The more of those lines I added, 
the sooner in the code it died; always somewhere around the 4 KB mark.  

I'll see about error logging to the database instead to see if it's dying 
completely or just the output it crashing.  

Our development server is an IIS/PHP 4.3 environment.  The live server is a 
4.0.6 box sitting behind a proxy server as well, which could be part of the 
problem.  The whole thing is a mess, I agree. :-)

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to