| 11:40 pm on Aug 9, 2012 (gmt 0)|
Any calls to ob_start ?
| 11:55 pm on Aug 9, 2012 (gmt 0)|
No. This is just a few functions with preg_match, str_replace and preg_replace and a few arrays.
|brotherhood of LAN|
| 12:15 am on Aug 10, 2012 (gmt 0)|
have you tried "echo 1;" near the top to see if anything is produced? If so, just keep echoing numbers until you can see where the script falls.
If there is still no output, try commenting out the lower pieces of code.
Not the best way to debug but should work.
| 1:24 am on Aug 10, 2012 (gmt 0)|
Can everyone assume you've done the routine checks for invisible errors? nbsp or tab for space, line-end space where there isn't supposed to be one, that kind of thing. All brackets match, nothing interlocking, all nests come out even? In short, the whole category of "D'oh!" errors that are so obvious you don't even think of them.
| 1:34 am on Aug 10, 2012 (gmt 0)|
Yeah. As far as I can see I've done all that.
print "hello"; on the very first line yields nothing if I add the other code after it.
I've now spent over 20 hours commenting bits of code out and still not an error message in sight.
| 5:52 am on Aug 10, 2012 (gmt 0)|
remove all functions/includes
run the code from a single function in your page
try to debug line by line
make sure you echo/print/var_dump something and that your function doesn't "return" an empty string
Have your full error reporting (E_ALL) in your php and htaccess file
other than that i know not any other way to debug
| 10:38 am on Aug 10, 2012 (gmt 0)|
So far, one missing bracket in a preg_match and a missing semi-colon.
That's brought 7 out of 8 functions to life. When I add the last one, it's a complete blank out, everything reverts to blank screen and no error messages.
Never had to add code one line at a time before.
| 12:17 pm on Aug 10, 2012 (gmt 0)|
Dang! An extra bracket inside one function and a missing bracket inside another.
| 10:13 pm on Aug 10, 2012 (gmt 0)|
:: twiddling thumbs and whistling idly ::
| 10:19 pm on Aug 10, 2012 (gmt 0)|
However, looking at the code as closely as I have over the last couple of days, I identified several potential bugs very early on and already fixed them along the way. Once the syntax was correct the whole thing worked exactly right, first time. I still have no idea why the simplest of syntax errors results in a completely blank screen and no error messages though. I've never spent so much time tracking down such simple errors.
| 10:26 pm on Aug 10, 2012 (gmt 0)|
Did you check the apache error log ? I usually keep a tail -f on that one ... and try to run the php from the command line as long as it's not too interactive -> gives you syntax errors that are IMHO easier to deal with.
| 10:38 pm on Aug 10, 2012 (gmt 0)|
One of those rare occasions with no log access, and couldn't override from within htaccess - and I did waste an hour or more trying to do that.
| 2:15 am on Aug 11, 2012 (gmt 0)|
|I still have no idea why the simplest of syntax errors results in a completely blank screen |
When I'm trying to make sense of someone else's code, the very first thing I do is add a line break before and/or after every single bracket. And then start indenting packages. That's where you get the "Oh, oops, these two elements were supposed to be parallel."
| 1:12 pm on Aug 11, 2012 (gmt 0)|
I thought I had done that.
However there was a disconnect between thinking and doing.