I\'ve just moved a site across to a production server, and a once working CodeIgniter installation now returns a blank screen. I believe it is due to whitespace, but how are
Declare this somewhere in your /index.php file:
function exception_handler($exception) {
echo "Uncaught exception: " . $exception->getMessage();
}
set_exception_handler('exception_handler');
It seems CodeIgniter (v2?) only handles exceptions that are derived from CI_Exception, so any uncaught exceptions (from third party libraries, etc) are not handled.
Load your url helper when you create a function, eg:
visibility function_name ()
{
$this->load->helper('url');
}
It will show you errors or a view you loaded.
The issue may be due to missing the php module 'mysqli'. This is the driver to your calling on the database. I would check that with:
php -i | grep mysqli
php -m
If you've moved to a new server ensure the server has PHP-5 installed on it. The reason why the screen is blank is because the server cannot render PHP yet.
Type this line in and restart after:
sudo apt-get install php5 libapache2-mod-php5
To restart:
sudo service apache2 restart
This is of course assuming you have access to the server via an SSH client with admin rights.
best of luck, Niall
I experienced the same issue and I solved it by setting my log-folder to writable. It seems, that if you turn on logging, and your log-folder on your server is not writable, CodeIgniter just shows you an empty page.
Things to check:
$config['base_url']
is set properlyOther things you can do:
$db['default']['db_debug']
to TRUE