White screen and its magical solution |
[eluser]#1313[/eluser]
This is my first time seeing such strange things happen. Pure magick. I had a stable and running CI application which used Views library. A few hours ago i decided to leave it and start using Rick Ellis' solution to templating (http://ellislab.com/forums/viewthread/44916/). I successfully moved my back-office to this new 'templating technique'. Then i started moving my news section, and then magic happened. The index() function of my News() controller ends with Code: $data['page']['title'] = 'News page'; and page.php view is Code: <?php Then in desperation i added Code: ini_set('error_reporting','E_ALL'); I received NO error messages, none at all. When i delete this ini_set line the white screen immediately returns. WTF? Here is my News controller. Code: <?php
[eluser]Michael Wales[/eluser]
Usually the pure white screen means there is a PHP error (syntax, something like that). Interesting that it's not echoing out any error though....
[eluser]#1313[/eluser]
I do receive messages from CI about php-notices and php-warnings, so i don't think that this is a PHP issue. ps: I am working under Apache on Windows, if it matters.
[eluser]Michael Wales[/eluser]
What are those messages? How high is your error_reporting bumped up (in config.php)? If the most common cause of the white screen is a PHP error, and CI is telling you all about these PHP Notices and Warnings, how could not think it was a PHP error?
[eluser]#1313[/eluser]
I mean that my level of error_reporting is high enough to receive notices and warnings. The fact that i did receive profiler info moves me to the conclusion that it was a bug connected to my views and/or variable loading.
[eluser]sophistry[/eluser]
sometimes when you use CI-reserved names for functions, things go haywire. do you have any functions named view, for instance?
[eluser]alexsancho[/eluser]
Are you sure that you php.ini has display_errors enabled?, add this line after your ini_set to ensure Code: ini_set('display_errors', 1);
[eluser]rainmanx[/eluser]
I don't know if this will help, but you could take a look at this: http://ellislab.com/forums/viewthread/56059/ . It was a problem I encountered that manifested the same blank screen. Maybe it helps. The blank screen usually means an error in your php syntax. It's not the first time an error does not trigger an error message and just stops. Do you have any code in the page source? If so, please post it. The same thing happened to me once; the app was running just fine on localhost, but was serving blank pages on the remote host. The solution - I changed the hosting provider :cheese:
[eluser]#1313[/eluser]
[quote author="sophistry" date="1188504039"]sometimes when you use CI-reserved names for functions, things go haywire. do you have any functions named view, for instance?[/quote] I was thinking about something like this, as i witnessed apache fail when i named one of my functions model() instead of car_model(). Maybe this time this issue is connected somehow to variable names, because my $data['view'] and $data['page'] variables do look a little suspicious from this p.o.v. Maybe somebody from the dev team can write down for us a list of 'bad words' in CI namespace? [quote author="rainmanx" date="1188512940"]I don't know if this will help, but you could take a look at this: http://ellislab.com/forums/viewthread/56059/ . It was a problem I encountered that manifested the same blank screen. Maybe it helps.[/quote] Yes, i've looked through that thread already, this is not my issue. Thanks anyway.
[eluser]sophistry[/eluser]
check the bottom of this manual page for the list of reserved names in CI |
Welcome Guest, Not a member yet? Register Sign In |