CodeIgniter Forums
Codeigniter installation on production server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Codeigniter installation on production server (/thread-54329.html)

Pages: 1 2


Codeigniter installation on production server - El Forum - 09-04-2012

[eluser]Manish Sunthwal[/eluser]
Hi,

I am using codeigniter framework, and was successful making my own application using this framework on my local machine (localhost). However, after completion of application, now when I upload the same on production server, I am getting below mentioned error.

======================
A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 346
======================

I have gone through almost all the topics covered in this forum regarding this problem faced by other CI users. However, unable to succeed.

My config.php code is configured as under:

================================================
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'abcd.com'; (here i have also tried 127.0.0.1, localhost )
$db['default']['username'] = 'visi5605_dm';
$db['default']['password'] = 'xxxxxx';
$db['default']['database'] = 'visi5605_ed';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = FALSE;
$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;
===============================================

Would really appreciate if someone could assist me out with the same.


Thanks & Regards,
Manish Sunthwal


Codeigniter installation on production server - El Forum - 09-04-2012

[eluser]TWP Marketing[/eluser]
The usual culprits are the hostname, username and password.

1) Can you login to your production database using the username and password? using phpmyadmin or such tools?

2) If you are attempting to connect to the production server from the same machine that contains your development environment, be sure that you are not using the same names in the HOSTS file (windows or linux). I ran into this because I use virtual hosting during development using the same host name as my intended production environment.


Codeigniter installation on production server - El Forum - 09-05-2012

[eluser]Manish Sunthwal[/eluser]
Yeah - I am able to connect to my production database using the same username and password. I am unable to find out where is the mess, I have tried all the possibilities while reading CI's earlier posts.


Thanks & Regards,
Manish Sunthwal



Codeigniter installation on production server - El Forum - 09-05-2012

[eluser]TWP Marketing[/eluser]
Sorry for the delay, I still don't see anything obvious which might be the problem.
Have you autoloaded the database library in your autoload.php config file? /config/autoload.php
Code:
$autoload['libraries'] = array('database');



Codeigniter installation on production server - El Forum - 09-06-2012

[eluser]Manish Sunthwal[/eluser]
Yeah - I did autoloaded my database while utilizing the power of config/autoload.php....

Very true - even I don't see any obvious reason as on why I am fetching this error... Sad

and yes it is obvious that I don't want to give up so soon - I am sure that together we can crack it... Smile

Thanks & Regards,
Manish Sunthwal



Codeigniter installation on production server - El Forum - 09-07-2012

[eluser]TWP Marketing[/eluser]
Just in case it is a really simple error...

Do the database names match?
Are you using the same database name: "visi5605_ed", on both local and production servers?


Codeigniter installation on production server - El Forum - 09-08-2012

[eluser]Manish Sunthwal[/eluser]
Nope... on my local server - db_name is different to the one on production server.


Codeigniter installation on production server - El Forum - 09-08-2012

[eluser]srpurdy[/eluser]
What version of mysql does the production server have? I know the mysql driver won't work on really old version 4's That's why I ask.


Codeigniter installation on production server - El Forum - 09-08-2012

[eluser]Manish Sunthwal[/eluser]
Server version: 5.5.23-55


Codeigniter installation on production server - El Forum - 09-08-2012

[eluser]srpurdy[/eluser]
[quote author="Manish Sunthwal" date="1347114042"]Server version: 5.5.23-55[/quote]

Client Version?