Unable to automatically upload / download database database data in codeigniter

I can not load a database library in the extracted default code CodeIgniter

1) through autoload.php

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

2) Internal controller through

 $this->load->library("database"); 

or

 $CI =& get_instance(); $CI->load->database(); 

Error message: The page can not be displayed because an internal server error.

Wednesday: CodeIgniter 2.1.3, PHP 5.2.13 in IIS (ISAPI), MySQL (5.0.45 -community-nt), Plesk.

I have confirmed that the code written in plain PHP, allows me to access the database.

As soon as I remove the library, I can see the page. I can load other libraries, such as conversation, and my own library. Any ideas what I am missing?

Here is my configuration database:

 $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'username'; $db['default']['password'] = 'password'; $db['default']['database'] = 'databasename'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; 'hostname'] = 'localhost'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'username'; $db['default']['password'] = 'password'; $db['default']['database'] = 'databasename'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; 'username'] = 'username'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'username'; $db['default']['password'] = 'password'; $db['default']['database'] = 'databasename'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; 'password'] = 'password'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'username'; $db['default']['password'] = 'password'; $db['default']['database'] = 'databasename'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; 'dbdriver'] = 'mysql'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'username'; $db['default']['password'] = 'password'; $db['default']['database'] = 'databasename'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; 
+4
source share
4 answers

you can check your server logs anyway or enable CI logs using config.php

go to line 206 of your config.php

 /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | | For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ $config['log_threshold'] = 4; 

set the value to 4 and check whether there is a directory /application catalog 775 chmod /logs , if not create that , the CI will automatically create log files in this directory.

you can check any CI error this way

HOW DO YOU ANSWER FROM THE FILING LOG

change, database.php line 50 in the / config directory:

 $db['default']['pconnect'] = TRUE; 

to

 $db['default']['pconnect'] = FALSE; 
+3
source

Ok based on the logs when I installed

$db['default']['pconnect'] = TRUE;

to

$db['default']['pconnect'] = FALSE;

database library loaded.

+2
source

I had the same problem and we spent about 5 hours troubleshooting, paving the way through the stack trace and mysql logs. It turns out the reason was unrelated, but I am posting here to save everyone I have experienced.

I am building my virtual machine from scratch and I obviously forgot to install the MySQL driver for php5. The symptoms that I had were exactly the same, a blank screen - no answer at all. For anyone who sees this in the future, make sure you have a mysql driver! 30 second fix.

0
source

It seems that you do not have your php5-mysql. In EC2 or your virtual machine, be sure to install php5-mysql

sudo apt-get install php5-mysql

0
source

All Articles