Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeIgniter - Blank page on database autoload

I encouter a problem since this morning, after I migrated my website from my local machine to the server.

To replace the context, I developed a website with the framework CodeIgniter, and everything before the migration was working fine.

After a long research, it seems that when i put this :

$autoload['libraries'] = array('database');

I have a blank page on my website, without any php/ci errors in the logs.

And if I let this :

$autoload['libraries'] = array();

The website is working correctly (well, I can't log in but I don't have a blank page).

I added the mysql.so in the php.ini file, but it didn't help me neither.

Does someone already encountered this problem ? How can you solved it please ?

Thanks !

B

like image 229
B F Avatar asked Jul 13 '11 14:07

B F


3 Answers

in application/config/database.php check that

$db['default']['dbdriver'] = 'mysql';

is set to

$db['default']['dbdriver'] = 'mysqli';
like image 105
Mancy Avatar answered Sep 16 '22 19:09

Mancy


I had a similar problem with blank pages seemingly associated with loading the database, be it via autoload or calling $this->load->database(); in the model constructor. I ended up having to modify my 'php.ini' file by commenting out extension=php_pdo_mysql.dll and uncommenting extension=php_mysql.dll (i.e. turning PDO back off). I am running Windows 8.1, Apache 2.2, and PHP 5.3.27.

This answer is similar to another, but I couldn't add a comment for clarification since I just signed up. It took me a couple of hours and a lot of Googling to resolve, so hopefully this helps somebody.

like image 28
Tim Avatar answered Sep 20 '22 19:09

Tim


Are you sure your db connection credentials are correct? If you switchd servers this seems like it might be the issue.

Additionally, CodeIgniter sets error_reporting(0) for production environments --- hence the blank page. Check your logs dir (is it writeable by the webserver process..?) for any other info.

like image 23
jlb Avatar answered Sep 16 '22 19:09

jlb