Welcome Guest, Not a member yet? Register   Sign In
Blank page with no errors problem
#1

[eluser]Tom Vogt[/eluser]
I'm installing an existing and tested CI application on a new server, and I can't get it to work for the life of me. There are no error messages in the apache log, no error messages displayed (even with E_ALL on and the app set to development) and no error messages anywhere else.

With some manual fiddling, I've tracked down the point where it stops to here in core/CodeIgniter.php:

Code:
/*
* ------------------------------------------------------
*  Instantiate the requested controller
* ------------------------------------------------------
*/
        // Mark a start point so we can benchmark the controller
        $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');

        $CI = new $class();

specifically, the $CI = new $class() line. Execution simply stops there. An echo statement right above still gets displayed, one afterwards not. $class is correctly set to my controller class name.

If I call the index.php directly in the URL, I do get an error message:
Quote: Fatal error: Class 'CI_Controller' not found in /home/brtool/htdocs/system/core/CodeIgniter.php on line 233

Which makes even less sense to me. (line 233 is thisSmile
Code:
231 function &get;_instance()
232 {
233  return CI_Controller::get_instance();
234 }


WTF is going on here ? I'm using CI 2.1 and PHP 5.4.4 - the same version the server where everything works just fine is using.

Totally lost here and thankful for any and all hints. Just figuring out what the fuck is going on would be a great help to me.
#2

[eluser]AlexandrosG[/eluser]
Hi! I have posted an almost same problem a few hour ago and i have just solved it (partially).

Please tell me first what are O.Ses of the old and new server.
In my case the problem was the controller file naming. You should use a capital letter for the first letter of the controller's class file.
#3

[eluser]Tom Vogt[/eluser]
That could be it, as I'm developing on OS X and my server is Linux. Except... that the server where everything works perfectly fine is also Linux.
#4

[eluser]AlexandrosG[/eluser]
Are your paths ok?

I am refering to the (BASEPATH, ROOTPATH, APPPATH). Especially APPPATH, which is used a lot in routing.
#5

[eluser]ivantcholakov[/eluser]
Copy the file system/core/CodeIgniter.php
as a new file application/core/MY_CodeIgniter.php.

Make the following change within your front controller index.php:

Code:
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*/
//require_once BASEPATH.'core/CodeIgniter.php';
require APPPATH.'core/MY_CodeIgniter.php';

In MY_CodeIgniter.php find the fragment:

Code:
// Load the base controller class
require BASEPATH.'core/Controller.php';

, modify it as follows:

Code:
// Load the base controller class
//require BASEPATH.'core/Controller.php';

and at the beginning of the file add the commented
"require" statement, here is the place:

Code:
/*
* ------------------------------------------------------
*  Load the global functions
* ------------------------------------------------------
*/
require_once(BASEPATH.'core/Common.php');

// Added here:
// Early load the base controller class
require BASEPATH.'core/Controller.php';
//

Tests locally these modifications, the application should
run, after that upload them on the production server.
See what would happen. This is not a solution of your
problem yet, you have a chance to see a more informative
error message.

My guess is that the class CI_Lang (it uses get_instance()
internally) tries to translate an error message before
a controller is instantiated. Most probably the database
driver is trying to complain. I think, you should check
your database connection eventually.

------------------

How it is possible to happen? If you have a routing system
based on slugs (and they are within database tables), then you
force connection to the database early, before the controller
has been instantiated. This is a case when get_instance()
calls fail, if something is wrong with the database connection.
#6

[eluser]CroNiX[/eluser]
Do you have php set to display errors to the screen?
#7

[eluser]Tom Vogt[/eluser]
Quick update: Alexandros was right on the case issue. The silent fail is now gone and I'm stuck with the error message I posted. Digging into that now.
#8

[eluser]Tom Vogt[/eluser]
Ok, checked a bunch of things to fix the remaining error. My database connection should work, I can connect from the commandline using the credentials from the config file. I don't use the database in routing, here's my routes.php:
Code:
$route['default_controller'] = "info";
//$route['404_override'] = 'errors/page_missing';

$route['([^/]+)/(.+)'] = '$2';
$route['(:any)'] = $route['default_controller'];

That second part might look weird, but it's due to some rewrite stuff I do for sub-sites. Think http://example.com/en/controller/method.

#9

[eluser]Tom Vogt[/eluser]
[quote author="CroNiX" date="1375805601"]Do you have php set to display errors to the screen?[/quote]

Yes, and I log them as well, and the "fatal error" line is the only thing that shows up.
#10

[eluser]Tom Vogt[/eluser]
Ok, I'm back to lowercase filenames, because according to the CI documentations, that is how it should be and the capitalized ones lead to 404 errors.

I tried the MY_CodeIgniter change and it does nothing.

So I'm still at silent fail. Here's the application logfile:

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

DEBUG - 2013-08-06 19:45:25 --> Config Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Hooks Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Utf8 Class Initialized
DEBUG - 2013-08-06 19:45:25 --> UTF-8 Support Enabled
DEBUG - 2013-08-06 19:45:25 --> URI Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Router Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Output Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Security Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Input Class Initialized
DEBUG - 2013-08-06 19:45:25 --> XSS Filtering completed
DEBUG - 2013-08-06 19:45:25 --> CRSF cookie Set
DEBUG - 2013-08-06 19:45:25 --> Global POST and COOKIE data sanitized
DEBUG - 2013-08-06 19:45:25 --> Language Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Loader Class Initialized
DEBUG - 2013-08-06 19:45:25 --> Config file loaded: application/config/myapp.php
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: url_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: my_url_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: form_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: doctrine_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: ckeditor_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: ajax_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: js_helper
DEBUG - 2013-08-06 19:45:25 --> Helper loaded: messages_helper
DEBUG - 2013-08-06 19:45:25 --> Language file loaded: language/de/myapp_lang.php
DEBUG - 2013-08-06 19:45:25 --> Database Driver Class Initialized




Theme © iAndrew 2016 - Forum software by © MyBB