database load issue |
[eluser]Unknown[/eluser]
I've seen several threads on this question, but there does not seem to be a consistent fix (any many of the questions are terribly written). It's also unclear if the problem is always user-build specific. Like many of the others running into this problem on the forums, I'm new to Code Igniter, but I'm loving the idea of a MVC framework. I'm running this locally on a MAMP build with PHP 5.3.5, mysql 5.5.9 and CodeIgniter 2.0.2. In the following I try to be as thorough as possible to narrow down where the error is happening. I'm getting a blank page when I load a database connection, but otherwise my code works fine. Here is a simplified version of my code: BlogTest.php Code: <?php Code: <html> Code: <?php My database.php file has my credentials and dbdriver as mysql. To be even more thorough, I tried taking the ['autoinit'] = FALSE. If I understand the config correctly, that means when I load the database library it does not try to connect automatically, so I think that means it's not my credentials that is giving me a blank page. I can connect to it just fine in mysql via my terminal and use the database I am trying to connect to. I do not have leading or trailing whitespace after my php tags (as one can tell since my html generally loads without my database call). I'm getting into the model just fine, since the "coming from model" text comes up. I do not get any error in my error log and my error_reporting is set to E_ALL in my config.php file. Any other thoughts as to what I'm doing wrong here? aTdHvAaNnKcSe
[eluser]CodeIgniteMe[/eluser]
Have you tried setting the error_reporting function in your index.php file?
[eluser]7thChosen[/eluser]
having the same problem, using CI 2.0.2, mysql 5.1 and PHP 5, getting a blank page whenever i use the line "$this->load->database();" in the controller (blog_view.php), or when i use the line "$autoload['libraries'] = array('database');" in the autoload.php file...
[eluser]danmontgomery[/eluser]
Check apache error log. Do you have the appropriate php module for whatever db driver you're using?
[eluser]7thChosen[/eluser]
thank you for suggesting checking the apache logs, it was in fact a wrong path in the httpd.conf file... grrr... awesome i was getting this error in the apache error log file: PHP Warning: PHP Startup: Unable to load dynamic library 'c:\\PHP\\ext\\php_mysql.dll' - No se puede encontrar el m\xf3dulo especificado.\r\n in Unknown on line 0 soo i fix the path in the httpd.conf file, at the end of the section where the "LoadModule" sentences are just add this line: LoadModule php5_module c:/php/php5apache2_2.dll or u can copy the file into the apache/modules directory and use: LoadModule php5_module moldules/php5apache2_2.dll soo now i can connect to my MySQL database using: $autoload['libraries'] = array('database'); in the autoload.php file of codeigniter or the $this->load->database(); sentence used in my controller... hope this help somebody else... here are some helpfull links i found that helped me fix this problem: http://www.webcheatsheet.com/PHP/install...acheconfig http://justcheckingonall.wordpress.com/2...n-windows/ thank you again, and happy coding... peace out |
Welcome Guest, Not a member yet? Register Sign In |