Welcome Guest, Not a member yet? Register   Sign In
Loading the database library causes a freeze
#1

[eluser]elverion[/eluser]
I'm working on another site using CodeIgniter (I've used CI plenty in the past without this issue), and am just about to begin working on the database side of things. I've added 'database' to the autoload config, but now upon trying to load any page, it just appears to continue loading for about 30 seconds before giving up and leaving the page completely blank. The same thing happens when I instead use $this->load->database() in a controller. As best as I can tell, the freeze happens within the database driver; specifically when trying to connect() or pconnect().

I've completely reinstalled Apache, PHP5, MySQL server, and CodeIgniter but the problem persists. All available logs contain no errors or any useful information what-so-ever. Any clues on where to even begin diagnosing the problem?
#2

[eluser]jrtashjian[/eluser]
Try turning on PHP errors in the php.ini file:

Code:
display_errors = On
error_reporting = E_ALL& E_STRICT

Also, make sure CodeIgniter has errors enabled in index.php:

Code:
error_reporting(E_ALL & E_STRICT);

See if that gives you any errors, debug from there.
#3

[eluser]InsiteFX[/eluser]
Also what version of CodeIgniter are you using?

InsiteFX
#4

[eluser]WanWizard[/eluser]
Looks like a timeout trying to connect to the database.

Verify your database configuration, make sure host and port are ok, and there are no firewall rules in the way.
#5

[eluser]elverion[/eluser]
I've checked the error reporting settings as requested. Still, no errors are reported. The only thing that shows is in the access log; and the only information that gives is that it returned code 500 (internal system error) on that access.

I've checked the database settings, as well. They appear to be fine. I'm able to access the database just fine using Navicat (using the same user). If it were an error connecting to the database, it should display that error. This just freezes up.
#6

[eluser]WanWizard[/eluser]
An error 500 is generated by your webserver, not by CI. So it looks like it doesn't even get to your code.
Do you have an .htaccess in place that could be wrong? Does you welcome controller load (without autoloading the database)?
#7

[eluser]elverion[/eluser]
[quote author="WanWizard" date="1289974024"]An error 500 is generated by your webserver, not by CI. So it looks like it doesn't even get to your code.
Do you have an .htaccess in place that could be wrong? Does you welcome controller load (without autoloading the database)?[/quote]
The internal system error only occurs when using the database library with CI, and it freezes within CI's database initialization function.

Even after removing the .htaccess file, the same thing happens. The welcome controller (or any other controller) loads just fine so long as the database class is not loaded.
#8

[eluser]InsiteFX[/eluser]
Are you using XAMPP, WAMP or some other Software?
Also what Operating System are you running?

InsiteFX
#9

[eluser]elverion[/eluser]
No, I am not using those softwares or any others that should be interfering with SQL connections. Currently, I'm testing under Windows 7 x64; the eventual host will be Linux-based.
#10

[eluser]JayKae[/eluser]
I figured I should use the existing thread instead of creating a new one. I too encountered this error. I wasn't getting any errors, just a blank screen. I isolated it down the my database.php config file. The issue was with the collation and char_set options.

The defaults didn't work.
Code:
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';

I had to change mine to the following.
Code:
$db['default']['char_set'] = 'latin1';
$db['default']['dbcollat'] = 'latin1_general_ci';

For reference I am using LiteSpeed SE 4.0.20 (downloaded from their site), PHP 5.3.6 (compiled from LiteSpeed GUI), and MySQL Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1 (Ubuntu 10.04 repository.) Not sure how to actually fix the issue or where it even is, but changing the char set and collation worked around the issue.




Theme © iAndrew 2016 - Forum software by © MyBB