Welcome Guest, Not a member yet? Register   Sign In
Please help, I get a weird blank screen
#1

[eluser]rainmanx[/eluser]
Hi guys,

I'm dealing with a very weird thing that CodeIgniter does.

I'm working on a project that uses databases, and when I try to autoload the database library, everything goes blank. The controllers start serving completely blank pages, with empty sources, not even a doctype is there...

Is it possible that I have a flaw in my Apache or PHP configuration?

I'm using Windows and I have installed Apache and MySQL as services.

Anyone had this problem before? Please help, thanks!
#2

[eluser]luisjose[/eluser]
Hello, I don't know if I could help you but because I am new to CI but I will try. I succesfuly did a pair of simple aplications with CodeIgniter using databases (one with MySQL and another one with PostgreSQL) and they work fine.
Could you please give a more detailed description of your problem? what do you do exactly to get those blank pages? what do you mean when you say "autoload the database library"?
#3

[eluser]Glen Swinfield[/eluser]
It sounds like there might be a missing file or an incorrect include/require path but the error reporting level is too low to report it - so you get blank pages.

This is just a guess, but a similar thing has happened to me before.

Set error reporting to E_ALL and see if you get an error message - try to force some errors. - look in the error log.

It's difficult to debug if you've got no error message.
#4

[eluser]rainmanx[/eluser]
[quote author="luisjose" date="1183997929"]Could you please give a more detailed description of your problem? what do you do exactly to get those blank pages? what do you mean when you say "autoload the database library"?[/quote]

Hi luisjose,

Thanks for trying to help.

First question: I can't think of any more detailed explanation for my problem except for what I've wrote in my first post. As soon as I autoload the database library (or any other library for that matter - even my own) nothing works and I get completely blank pages, no matter what URI I type in the browser. The source looks completely blank too.

Second question: By autoloading a library I mean loading it through application/config/autoload.php, and modifying the Auto-load libraries section, such as below:
Code:
$autoload['libraries'] = array('database', 'my_library', 'other_library');

I tried to load it through my controller, with
Code:
$this->load->database();
, but I get the exact same result.
#5

[eluser]Crimp[/eluser]
The likely cause is whitespace in your PHP files. If you copy and paste code from the manual, for example, you will import those little buggers. Turn on invisibles in your editor and check.
#6

[eluser]rainmanx[/eluser]
[quote author="gms" date="1183999339"]Set error reporting to E_ALL and see if you get an error message - try to force some errors. - look in the error log.[/quote]

Hi gms,

I had already set error reporting to E_ALL. If I try to load a library that doesn't exist, I get an error message. But on this particular problem, I'm not getting any error messages - only blank pages.

As I told Luis on my previous reply, if I try to load a library of my own, the same thing happens no matter if I autoload it or manually load it through the controller.

What error log do you have in mind? Where should I look for it?

Thanks
#7

[eluser]Glen Swinfield[/eluser]
Post some code - that may help - it could be any of a number of things.

Also try what Crimp suggests and check for whitespace after your ?> tags in your libs.

/system/logs - will contain an activity log that may throw something up.
#8

[eluser]rainmanx[/eluser]
I've managed to autoload my own libraries - the mistake was completely mine, I forgot to put "private" before my variable...

Connecting the database still doesn't work, autoloading it or not. There really isn't any code to post, I did'n get to do anything but the controller-view structure.

I've downloaded a completely new and clean CI copy. I've created a test application and a test database; I didn't modify anything in this app except for
Code:
$autoload['libraries'] = array('database');
(in the application/config/autoload.php)
or
Code:
$this->load->database();
(in the controller).

Still the same blank page.

I checked the logs folder and it's empty, except for the "Directory acces forbidden" index.html.

I haven't tried my app on the remote server yet, only on localhost. This will be the next step.
#9

[eluser]luisjose[/eluser]
rainmanx, if you don't have code but the controller-view structure, it is obvious you have blank pages, because you have nothing. If you write:
$autoload['libraries'] = array('database');
and you have no errors, it's ok, everything is right, but you need to do something with the database in order to get something more than a blank page (i.e. extract records from a table and dump the information to the screen).
#10

[eluser]rainmanx[/eluser]
[quote author="luisjose" date="1184009755"]rainmanx, if you don't have code but the controller-view structure, it is obvious you have blank pages, because you have nothing.[/quote]

No, it's not that, because the views actually contain code - the doctype, title, links to css's and scripts and the <html><body></body></html> code. And I've also written code such as
Code:
<p>This is the "page_name" content</p>
in each view, in order to test the controller-view functionality.

As long as I don't load the database library, it all works fine. The minute I load it, I start getting blank pages.

Even though I repeat myself, by "blank" I mean no code at all in the page source, not even doctype. Nothing.

I have tested it on the remote server and... it works. :gulp: On localhost it doesn't.

Could it be a path issue, given I use Windows??




Theme © iAndrew 2016 - Forum software by © MyBB