Welcome Guest, Not a member yet? Register   Sign In
Strange problem: codeIgniter just died down, no database or anything involved..
#1

[eluser]Fabdrol[/eluser]
Hi Guys,

I have this really annoying problem.. While working on a codeIgniter project, I started out with a simple controller which writes "hello" into a page:

Code:
<?php
    class Dynamics extends Controller {
        function __construct() {
            parent::Controller();
        }
        
        function index() {
            $data['hello'] = "<h1>Welkom, bezoeker #". $this->uid() ."!</h1>";
            $this->load->view('dashboard', $data);
        }
        
        function uid() {
            mt_srand((double)microtime()*1000000);
            $uid = mt_rand(1, mt_getrandmax());
            return $uid;
        }
    }

It all worked fine. Then I continued work, wrote a little model, did some coding in a view and whamm.. my pages went blank.
Well, I knew of the 'autoloader' functionality, so I played a bit around in my database settings, removed database out of the autoloader into the class but nothing worked. Then, I decided to go back to basics and remove all database-related functionality.

So, everything was back to when it worked. but now, it doesn't work at all! what is wrong with my server? it is getting human-like habits.. and that bothers me, what if my webserver/macbook turns into a all-eating monster?!

Well, I started to play around and it seemed that it was caused by the log config.. i had set the log config entry to 4, and apparantly that is something CI doesn't like..

I hope this helps somebody!

Fabian
#2

[eluser]Derek Allard[/eluser]
You could try turning on logging and error messages and see if you get more informative information (more info).

Blank pages are almost always the result of error messages getting suppressed by the server. Ask you host if you can enable them if turning them on yourself doesn't work.
#3

[eluser]Fabdrol[/eluser]
Hi Derek,

Well, error logging doesn't really work at my setup, probably the directories aren't writeable or so..
anyway, I got stuff working by removing the logging config items..

Maybe nice for a next release of CI: set a check for logging which looks for denied access etc etc, and
prevents the system from dying when it can't log..

all the best,

Fabian
#4

[eluser]Derek Allard[/eluser]
Thank Fabian. CodeIgniter trusts that a developer who has logging enabled in config has taken the time to meet its requirements (notably writable dirs). Adding checks for writable dirs would only slow the whole system down, and additionally, windows servers often mis-report if something is actually writable or not, causing us to add "is_really_writable()" into Common Functions.
#5

[eluser]Fabdrol[/eluser]
[quote author="Derek Allard" date="1211882974"]Thank Fabian. CodeIgniter trusts that a developer who has logging enabled in config has taken the time to meet its requirements (notably writable dirs). Adding checks for writable dirs would only slow the whole system down, and additionally, windows servers often mis-report if something is actually writable or not, causing us to add "is_really_writable()" into Common Functions.[/quote]

allright allright, it was just a tought! No hard feelings!

thanks anyway ;-)

all the best,

Fabian




Theme © iAndrew 2016 - Forum software by © MyBB