• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tracking down a DB connection error


Thanks for the response!

Just added new line as you stated. Unfortunately, I'm still getting same blank view and blank source.

Anything else I can try?


This sounds like exactly the same issue I had.

I forget how I diagnosed it but there was a "php.ini" file somewhere on my windows system from an earlier install. That version had no libraries in it (or something, I'm not at home right now).

I think I deleted the old version and it found the new one.

Maybe try this: Use the Windows Explorer to search for any folders named "php".

The computer I'm on now didn't have a previous version of PHP on it so I just installed PHP 5.2.8 on it very recently. I just uninstalled PHP, then did a search with Windows Explorer to see if there were any PHP config-related files still floating around my system (specifically any .ini files) but there were none. As far as I could see (and we're talking just about 5 minutes ago) PHP was fully off my computer. I just did a new install and retried loading the database library but am still getting the same error.

I must be missing something somewhere! What, I don't know.

Thank you for your suggestion though! I was hoping that would work.


In case anyone is still having this same issue, I was able to solve this -- for my particular environment anyway.

Here, again, is my particular environment. In case anyone else comes across this and happens to be experiencing the same error and has the same (or similar) setup:
- Windows XP Pro
- PHP 5.2.8
- Apache 2.2.11
- MySQL 5.1

After searching all afternoon, here's the suggestion I found that fixed it: copy the php.ini file from C:\PHP into the Apache bin directory (for me it's C:\Apache\bin).

That was it.

That was all I had to do and now I can autoload the database library in Codeigniter just as the user guide says to and it works just fine. No more blank pages. I set up a quick test page just to make sure by putting this in a simple php page:

$conn = mysql_connect('server', 'username', 'password');
if($conn) {
  echo 'Finally connected!!!';
} else {
  die('Still cannot connect' . mysql_error());

After restarting Apache and loading up the test php page, I got the "I'm finally connected!!!" message so I knew it was working.

So if anyone has a similar setup as I have listed above, and you KNOW you've gone through all the proper php.ini configurations but have NOT yet copied php.ini into your Apache bin folder, try that and see if it works.

My particular PHP installation is not from the .msi Windows installer file...it is from the zip package. There are many many additional files and extensions needed to get this to work properly that you don't get from the msi installer file so you're better off downloading the zip package version and just extracting all those files right to C:\PHP.

Other people might still be having trouble with this for different reasons (different server/database/OS setup, etc) but this is just what helped me with my particular set up.

I hope this will help someone else!!

- Tony

exact solution here ;]


Hi there,

I can't find that page: when I cut and paste that URL into my browser, it says "You are not authorized to perform this action".

Any ideas?


I just had exactly the same problem on Ubuntu - the complete lack of errors in either the apache or codeIgniter logs made it hard to track down.
It turned out that I needed to do
sudo apt-get install libapache2-mod-auth-mysql
as well as install mysql, apache and php5-mysql.
Having done that and re-started apache has got rid of my 500 errors.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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