Welcome Guest, Not a member yet? Register   Sign In
Blank Page, Nothing in Logs?
#1

[eluser]jimbiancolo[/eluser]
Hi folks,

Sorry to bother you with total newbie stuff, but I just inherited my first CI project, and I'm trying to get a local development environment up, and when I try to go to load the project home page I just get a blank page.

So first I checked my Apache logs. It shows the request with HTTP status of 500. So I went looking for the CI logs, found they were off, and turned them on. Reloaded and checked the CI logs (log_threshold=4), and saw debug messages, but no errors, which puzzled me. Here's what was logged:

Code:
DEBUG - 2009-04-05 19:01:53 --> Config Class Initialized
DEBUG - 2009-04-05 19:01:53 --> No URI present. Default controller set.
DEBUG - 2009-04-05 19:01:53 --> Router Class Initialized
DEBUG - 2009-04-05 19:01:53 --> Output Class Initialized
DEBUG - 2009-04-05 19:01:53 --> Input Class Initialized
DEBUG - 2009-04-05 19:01:53 --> XSS Filtering completed
DEBUG - 2009-04-05 19:01:53 --> XSS Filtering completed
DEBUG - 2009-04-05 19:01:53 --> Global POST and COOKIE data sanitized
DEBUG - 2009-04-05 19:01:53 --> URI Class Initialized
DEBUG - 2009-04-05 19:01:53 --> Language Class Initialized
DEBUG - 2009-04-05 19:01:53 --> Loader Class Initialized

So I tried tracing through the code. First I went to index.php and put in a bunch of print statements to try to zero in on the error. I determined that these lines all ran successfully:

Code:
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');
define('APPPATH', BASEPATH.'application/'.$application_folder);

... but that something was failing on this line:

Code:
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

So I went into that file (CodeIgniter.php), doing more prints, and the problem seems to lie on line 158:

Code:
$CI  = new $class();

I can print before this line, but everything after it is dead. $class seems to be equal to "home" at this juncture.

Any help would be much appreciated! Also, I figure a more detailed explanation of the error must be showing up somewhere and I'm just missing it. But if not in the Apache logs and not the one CI log I know of, where should I look?

Thanks!

Jim
#2

[eluser]sophistry[/eluser]
welcome to CI!

these are a few things i've seen cause the white screen of death:
1) capitalization variations - try changing the capitalization of filenames and or class names
2) overlapping function names - eg. when i moved from PHP4 to PHP5 i had a custom function that had the same name as a new PHP5 function. when i rennamed the custom function the site worked again
3) whitespace or control chars emitted somewhere they shouldn't be - check for whitespace, or maybe you copy pasted code from a browser and it included some weird control chars?

GL
#3

[eluser]jimbiancolo[/eluser]
Thanks for the reply, GL! I'll have a look, but unfortunately all I did was copy working code from the live system to my local development environment, updated config.php and database.php, and tried to run it, so I'm not sure I could have introduced any of these problems.

I'm a bit stymied by the lack of any kind of error message in the log giving me more insight into the 500. Is there a way to make CI throw the PHP error?

It seems like the two possibilities are that I screwed up the config changes (although the code is running, it's just erroring at a particular place) or it's an environment problem. The live site is running CI 1.3.3 under PHP 4.4.8, while my local setup is running PHP 5.2.9. Normally upgrading CI would be the first thing I'd try, but the code does work on the live site, and I haven't been authorized to make those kinds of changes.

Thanks again!

Jim
#4

[eluser]sophistry[/eluser]
wow. CI 1.3.3?

it sounds like you might have run into a PHP5 issue to me. did you check for conflicting function names as suggested in #2? also, there are going to be issues with moving CI 1.3.3 to PHP 5.2.9 because those two versions never really "lived together" PHP5.2.9 was just released and CI 1.3.3 was released June 2006 (almost three years ago - and probably 2000 bug fixes ago!)

i think it will work, but you'll have to keep plumbing the depths of the loader code to get at what is making it bail with the server error. I think the 500 server error is tricky (or impossible) to trap with CI... not sure about that though.

BTW, GL = good luck. ;-) not my initials.

GL
#5

[eluser]jimbiancolo[/eluser]
Ha! How I've gone this many years without seeing "GL" is beyond me!

Yeah, 1.3.3... I should push them to upgrade. I worry that's going to be big task, given how many versions have come since then!

I'll look for conflicting function names, thanks again!

Jim
#6

[eluser]jimbiancolo[/eluser]
Ugh, turns out this thread is not one of my prouder moments. The "GL" thing is trivial compared to not noticing I didn't have mysql support turned on in my PHP config!

I figured it out when I found the PHP error_log, while lies between the Apache logs and the CI logs. New to PHP in addition to CI. :-)

Anyway, I'm online now, my bad, sorry for cluttering the board!
#7

[eluser]sophistry[/eluser]
thanks for documenting the fix even though it was an ignominious moment for you. add "lack of mysql PHP support in PHP.ini" to the list of things that can cause the "white screen of death"...

just to clarify. are you talking about PHP.ini mysql settings or CI database.php settings?
#8

[eluser]jimbiancolo[/eluser]
php.ini. On Windows, I just had to uncomment the line:

extension=php_mysql.dll

... and restart Apache and I was good to go.

Thanks again for your help!
#9

[eluser]Unknown[/eluser]
Same problem with the white screen on my development Mac. I had used Macports to install php 5.3 and didn't include php5-mysql so there was no MySQL support in the PHP build. running port install php5-mysql fixed it. To me this is a deficiency in CodeIgniter. Seems like there should be a check for MySQL support and some kind of an error message if it's missing.
#10

[eluser]divayank[/eluser]
Hi,
I am getting same issue that "jimbiancolo" got.
Blank page appear when I'll open website url.
After my exploration
Code:
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

So I went into that file (CodeIgniter.php), doing more prints, and the problem seems to lie on line 201:
Code:
$CI  = new $class();

I can print before this line, but everything after it is dead.

I am using PHP Version 4.3.9 , mysql version 4.1.22
Mod_rewrite is also enabled on server.

I have used CodeIgniter_1.7.2.zip install.




Theme © iAndrew 2016 - Forum software by © MyBB