Welcome Guest, Not a member yet? Register   Sign In
How can I debug my CI code when getting a blank (white) page?
#1

[eluser]Scouser[/eluser]
Can someone please tell me how to debug my CI code when I constantly receive a blank - white - page, I can't seem to figure out where the error is. So I'm looking for a way to more thorougly go over my code in runtime mode, instead off just plain ol' reading.
#2

[eluser]gunter[/eluser]
set some echo´s...
echo "hello - here is index.php";
echo "Welcome Controller constructor says hello!!!!";
and so on...


and switching on the logging in the config.php maybe helps a little too, so you can see, if the libraries get loaded...
#3

[eluser]Scouser[/eluser]
thanx, but I already tried that, but it keeps displaying a nasty white page. My provider doesn't show me the error.log so that won't help either. Any other options?
#4

[eluser]Derek Allard[/eluser]
does a totally stock install of CI work even?
#5

[eluser]Scouser[/eluser]
I only get this blank page with using the pagination class every other page is shown correctly, but for some reasong I get this weird blank page, with no errors. I probably are overlooking something but I seem to miss it.
#6

[eluser]Pascal Kriete[/eluser]
The way I always debug these is by adding
Code:
ini_set('display_errors','On');
To my index.php, that way syntax errors and the like show up.
#7

[eluser]James Pax[/eluser]
[quote author="gunter" date="1207527706"]set some echo´s...
echo "hello - here is index.php";
echo "Welcome Controller constructor says hello!!!!";
and so on...


and switching on the logging in the config.php maybe helps a little too, so you can see, if the libraries get loaded...[/quote]

lol that iswhat I do too xD ...loads of random echos in my text lol
#8

[eluser]Daniel Eriksson[/eluser]
The Apache error log is a very useful source of information when debugging problems!

/Daniel
#9

[eluser]John_Betong[/eluser]
 
Hi Scouser,

// a blank - white - page,

Been there and got the T-shirt Sad

I find debugging in PHP about the same as debugging in Basic on a Tandy TRS80.

What makes it worse is that it is difficult to set breakpoints at the start, end, half way, etc because of not knowing the order that programs get called.

If you are fortunate enough to be able to load your Contoller the I use this debug code line and and gradually move it towards the View.

Code:
echo 'File: ' .__FILE__ . '  : Line: ' .__LINE__; die;

Cheers,

John_Betong
 

"With age come skills; it's called multi-tasking. I can laugh, cough, sneeze, fart and pee all at the same time."

 
#10

[eluser]Majd Taby[/eluser]
a white page most probably means you have display_errors turned Off....if you can't access your php.ini file and restart apache, then you can probably read your error log. If you can't...i think you just have to find your php bug...setup a development server on your local machine and put the code there.




Theme © iAndrew 2016 - Forum software by © MyBB