• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Lib Loading Issue

For some reason, when I try to start the database library (in autoload or controller) CI fails to run properly. Without it, I can load my welcome controller in an instant - with it, it loads for several minutes before displaying a blank page - Apache reports a 200 message in the log.

No errors are displayed or logged, and nothing appears to be initialised (welcome has profiler on).

I'm using 1.7.2 with MySQL 5.1 on Apache 2.2 on Win7. I've recently updated all the server apps and now all of my sites with the db lib fial in the same way. It doesen't seem to matter if the database.php file is correctly configured or not.

Anyone else seen this or have a solution? Help!!


A connection problem, where PHP waits on a timeout when it tries to connect to the database?

MySQL running? On the correct port? No firewall (or other magical windows stuff) issues between webserver and database server?

Ok ignore me. This isn't a CI issue.

CI-induced lazyness has got me into bad habbits. I've just run an manual db connect script and that's suffering from the same issues... *sigh*


Ok, sorted. This is a known PHP issue - http://bugs.php.net/bug.php?id=50172

The solution is to uncomment or add localhost to you hosts file. Apparently, it can't work it out... Some people have reported that using instead of localhost worked for them, but not for me. The hosts edit has worked though!

What that bug report says is that you have this issue if your windows environment is dual stacked (IPv4 and IPV6), and you have "localhost" defined in your hostfile for both IPv4 and IPv6 local addresses.

You should already have a 'localhost' entry in your hosts file (c:\windows\system32\drivers\etc\hosts), chances are that you have two: one with, and one with ::1. If you don't, someone has modified the hosts file.

Make sure only the entry is present, remove the ::1 (IPv6) entry. If you don't use IPv6 in your network, disable the entire stack. Nothing but trouble if you don't need it.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.