Welcome Guest, Not a member yet? Register   Sign In
Blank page and endless loop when uploaded to web server (solved)
#1

[eluser]mecharius[/eluser]
Hi guys,
I've been using CI for a while now and I think I'm getting the hang of it. First post here though!

I've been developing an app on my local PC and it works perfectly (latest version of XAMPP). I've also recently changed PCs and copied everything across and it seems to work perfectly on the machine as well. However when I upload my app to my web server I encounter the blank screen that a number of forum posts have talked about - nothing displays, no source code when you view source. Some controllers work, and it can access the database as the error only occurs after a user logs on and goes to the database.

I've tried quite a few things after looking around the forum posts - checked the mySQL installation and PHP version (other non-CI apps using mySQL work), checked for empty or missing source links, etc. etc. etc.

After placing debugging notes in my code I can see that there is an endless loop occurring in the CI execution... see below:

Code:
ERROR - 2007-12-08 11:18:21 --> *** User Admin has logged in ***
DEBUG - 2007-12-08 11:18:22 --> Config Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Hooks Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Router Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Output Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Input Class Initialized
DEBUG - 2007-12-08 11:18:22 --> XSS Filtering completed
DEBUG - 2007-12-08 11:18:22 --> Global POST and COOKIE data sanitized
DEBUG - 2007-12-08 11:18:22 --> URI Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Language Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Loader Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Database Driver Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Session Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Encrypt Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Controller Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Helpers loaded: url
DEBUG - 2007-12-08 11:18:22 --> Helpers loaded: form
DEBUG - 2007-12-08 11:18:22 --> Table Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Model Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Model Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Model Class Initialized
DEBUG - 2007-12-08 11:18:22 --> Model Class Initialized
ERROR - 2007-12-08 11:18:22 --> **** Teams controller loaded *****
ERROR - 2007-12-08 11:18:22 --> **** Teams --> INDEX loaded *****
ERROR - 2007-12-08 11:18:22 --> **** 1 *****
ERROR - 2007-12-08 11:18:22 --> **** 2 *****
ERROR - 2007-12-08 11:18:22 --> **** Teams --> VIEW start loading *****
ERROR - 2007-12-08 11:18:22 --> **** 101 *****
ERROR - 2007-12-08 11:18:22 --> **** 102 *****
ERROR - 2007-12-08 11:18:22 --> **** Teams --> VIEW start loading *****
ERROR - 2007-12-08 11:18:22 --> **** 101 *****
ERROR - 2007-12-08 11:18:22 --> **** 102 *****

Note the lines after Teams --> VIEW start loading repeat endlessly for about 1.8MB! Also not sure why the view function of team controller is being called here as I've asked for the index function!

I can't seem to tie this down to a single line because if I delete the line below #2, the same errors occurs but at debug line #3 and so on. It does work when I comment out everything and replace with a simple echo statement.

Does anybody have any ideas on what could be causing this?

Code:
function index()
    {
        log_message('ERROR', '**** Teams --> INDEX loaded *****');
        
        // start benchmarking
        $this->benchmark->mark('process_start');
        
        // get the standard headers and footers, etc.
        $config['submenu_data'] = array('draw' => TRUE, 'type' => 'configure_team');
        log_message('ERROR', '**** 1 *****');
        $config['mainmenu_data'] = array('draw' => TRUE, 'type' => 'system');
        log_message('ERROR', '**** 2 *****');
        $data['header'] = $this->load->view('standard/header_view',$config, TRUE);
        log_message('ERROR', '**** 3 *****');
        $data['mainmenu'] = $this->load->view('standard/mainmenu_view',$config, TRUE);
        log_message('ERROR', '**** 4 *****');
        $data['submenu'] = $this->load->view('standard/submenu_view',$config, TRUE);
        log_message('ERROR', '**** 5 *****');
        $data['login'] = $this->load->view('standard/login_view',$config, TRUE);
        log_message('ERROR', '**** 6 *****');
        $data['sidebar'] = $this->load->view('standard/sidebar_view',$config, TRUE);
        log_message('ERROR', '**** 7 *****');
        
        // get the team list
        $config['team_list'] = $this->MTeams->getTeams(NULL);
        $data['content'] = $this->load->view('teams/teamlist_view',$config, TRUE);

        // get the benchmark time
        $this->benchmark->mark('process_end');
        $config['elapsed_time'] = $this->benchmark->elapsed_time('process_start','process_end');
        $data['footer'] = $this->load->view('standard/footer_view',$config, TRUE);

        // display the page
        $this->load->view('page_view',$data);
        
        log_message('ERROR', '**** End of Team->Index *****');
    }

(The models are all loaded in the controller's constructor.)


Thanks,
Mech
#2

[eluser]tonanbarbarian[/eluser]
Can you post the standard/header_view file as well
#3

[eluser]mecharius[/eluser]
Hey, its basically a whole lot of CSS code. I've checked all the links generated and they point to files so I don't think its a faulty link. Here is the code. Note that I get the same error if I comment out this view, but at the next line in the controller code.


Code:
<?php
    // area to set up default colours
    
    // background colours
    $body_background = "#222222";
    $light_background = "#F0F0F0";
    $dark_background = "#667799";
    $alternate_background = "#CCCCFF";
    $textarea_background = "#FFFFFF";
    $success_background = "#CCFFCC";
    $error_background = "#FFCCCC";
    $white_background = "#FFFFFF";

    // border colours
    $dark_border = "#000000";
    $light_border = "#D0D0D0";
    $success_border = "#AACCAA";
    $error_border = "#CCAAAA";
    
    // text colours
    $link_textcolour = "#003399";
    $standard_textcolour = "#000000";
    $alternate_textcolour = "#CCCCFF";
    $light_textcolour = "#F0F0F0";
    $white_textcolour = "#FFFFFF";

?>


<title>bCMT by Mecharius Projects</title>

<style type="text/css">

.rating_attribute_name {
    width: 150px;
    font-weight: bold;
    font-size: 75%;  
    float: left;
}

.boxscore_list {
border: 1px solid <?= $light_border ?>;
margin-left: auto;
margin-right: auto;
width: 90%
}

.colour_bar {
width: 90%;
height: 80px;
color: #000000;
background-color: #000000;
font-weight: bold;
margin: auto;
background-image: url('<?= base_url()?>system/application/images/orange_gradient.jpg');
}

</style>


I've removed some of the CSS because there is a fair bit of it. Thanks...
#4

[eluser]gtech[/eluser]
hello I copied your index function and adapted it below... just so it works on my set up.
Code:
function index()
    {
        log_message('ERROR', '**** Teams --> INDEX loaded *****');
        
        // start benchmarking
        $this->benchmark->mark('process_start');
        
        // get the standard headers and footers, etc.
        $config['submenu_data'] = array('draw' => TRUE, 'type' => 'configure_team');
        log_message('ERROR', '**** 1 *****');
        $config['mainmenu_data'] = array('draw' => TRUE, 'type' => 'system');
        log_message('ERROR', '**** 2 *****');
        $data['header'] = $this->load->view('test_v',$config, TRUE);
        log_message('ERROR', '**** 3 *****');
        $data['mainmenu'] = $this->load->view('test_v',$config, TRUE);
        log_message('ERROR', '**** 4 *****');
        $data['submenu'] = $this->load->view('test_v',$config, TRUE);
        log_message('ERROR', '**** 5 *****');
        $data['login'] = $this->load->view('test_v',$config, TRUE);
        log_message('ERROR', '**** 6 *****');
        $data['sidebar'] = $this->load->view('test_v',$config, TRUE);
        log_message('ERROR', '**** 7 *****');
        
        // get the benchmark time
        $this->benchmark->mark('process_end');

        log_message('ERROR', '**** End of Team->Index *****');
  }

I then created a view called test_v and copied the view you posted above... guess what it worked:

Code:
ERROR - 2007-12-07 23:22:57 --> **** Teams --> INDEX loaded *****
ERROR - 2007-12-07 23:22:57 --> **** 1 *****
ERROR - 2007-12-07 23:22:57 --> **** 2 *****
DEBUG - 2007-12-07 23:22:57 --> File loaded: C:/xampp/htdocs/survey/survey_dev/system/application/views/test_v1.php
ERROR - 2007-12-07 23:22:57 --> **** 3 *****
DEBUG - 2007-12-07 23:22:57 --> File loaded: C:/xampp/htdocs/survey/survey_dev/system/application/views/test_v1.php
ERROR - 2007-12-07 23:22:57 --> **** 4 *****
DEBUG - 2007-12-07 23:22:57 --> File loaded: C:/xampp/htdocs/survey/survey_dev/system/application/views/test_v1.php
ERROR - 2007-12-07 23:22:57 --> **** 5 *****
DEBUG - 2007-12-07 23:22:57 --> File loaded: C:/xampp/htdocs/survey/survey_dev/system/application/views/test_v1.php
ERROR - 2007-12-07 23:22:57 --> **** 6 *****
DEBUG - 2007-12-07 23:22:57 --> File loaded: C:/xampp/htdocs/survey/survey_dev/system/application/views/test_v1.php
ERROR - 2007-12-07 23:22:57 --> **** 7 *****
ERROR - 2007-12-07 23:22:57 --> **** End of Team->Index *****

the only way I could replicate your error was to delete test_v1 (my view), and then of course the log halted at #2. To me it would suggest you view files are not getting picked up?

but i cant see where you were logging
**** Teams --> VIEW start loading *****

if that was in the view then maybee just put the word "hello world" in your view and see if it loads ok.
#5

[eluser]tonanbarbarian[/eluser]
you have the following in your controller
Code:
...
log_message('ERROR', '**** 2 *****');
$data['header'] = $this->load->view('standard/header_view',$config, TRUE);
log_message('ERROR', '**** 3 *****');
...
and yet you are getting the log output of
Code:
ERROR - 2007-12-08 11:18:22 --> **** 2 *****
ERROR - 2007-12-08 11:18:22 --> **** Teams --> VIEW start loading *****
ERROR - 2007-12-08 11:18:22 --> **** 101 *****
ERROR - 2007-12-08 11:18:22 --> **** 102 *****
ERROR - 2007-12-08 11:18:22 --> **** Teams --> VIEW start loading *****
ERROR - 2007-12-08 11:18:22 --> **** 101 *****
ERROR - 2007-12-08 11:18:22 --> **** 102
so why I asked t osee the view was because I expected to see something like
Code:
...
log_message('ERROR', '**** 101 *****');
...
log_message('ERROR', '**** 102 *****');
...
but that is not in the view
can we see the code that is putting those lines into the log
Your problem has to be somewhere in that
#6

[eluser]mecharius[/eluser]
Hey tonanbarbarian... thanks for your input so far. Whilst I was typing the response I think I came up with an answer... The Teams --> View line refers to another function which is getting called whenever ANY view is being called from the index function.

I think for some reason the Linux install is confusing

Code:
$this->load->view(xxxx);

and the view function in the teams controller. This is not happening on my windows dev machines, only on the webserver. I'll change this and see if it fixes my problem. Stay tuned!
#7

[eluser]mecharius[/eluser]
Ok, I've renamed all the "view" functions to "viewevent," "viewteam" etc. and it seems to be working. So it looks like this is only an issue on linux based servers...

Thanks to those who responded.
#8

[eluser]smalter[/eluser]
Hi all,

i think i have the same problem.

i have tested my app in my webserver (ovh.net) but i can't load any pages. (endless loading) but after 1 minute, the page are patrially displayed (database query is ok) but without css/images. Confused

Mod_rewrite is set to on, php5 too.
I have tested this. But it is dont work.

Any have an idea?

My .htaccess:

Code:
AuthUserFile /home.10.14/jacquess/www/beta/pwd/.htpasswd
AuthGroupFile /dev/null
AuthName "Addict2Night"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

EDIT: My phpinfo: http://240gp.ovh.net/test.php




Theme © iAndrew 2016 - Forum software by © MyBB