Welcome Guest, Not a member yet? Register   Sign In
Bonfire CMS

I couldn't register on the Bonfire forums , so i figured this would be the second best bet.
m trying to work with the codeigniter CMS BONFIRE.I've used codeigniter before, I actually have an installation of both pure codeigniter and bonfire on my local server.First off I've been having trouble with my .htacess files on my xammp server but that's a topic for another day.My Bonfire installation for some reason will not recognize my database settings in application/config/database.php
they are something like
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '$username';
$db['default']['password'] = '$password';
$db['default']['database'] = 'bonfire';
$db['default']['port']     = '3306';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = 'bf_';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$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'] = TRUE;

where $ username is my username and $ password is my password but (obviously i cant show it).
i get this error
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: C:\xampp\htdocs\Bonfire-master\bonfire\codeigniter\database\DB_driver.php
Line Number: 124

you cannot put variable in single quote.

Quote:where $ username is my username and $ password is my password but (obviously i cant show it).

I interpret that to mean that 
PHP Code:
$db['default']['username'] = '$username';
$db['default']['password'] = '$password'

is actually something like
PHP Code:
$db['default']['username'] = 'rhodoscoder';
$db['default']['password'] = 's3krEt'

so the problem isn't that you're actually surrounding variables with single quotes.

But everything else looks fine. This is where a debugger comes in handy.

Line 124 of DB_driver.php just sends the error message. The error actually occurs before, when depending on the pconnect setting, either db_pconnect() or db_connect() are called in mysql_driver.php. Since you have pconnect set to FALSE, the error must be coming from db_connect(), which starts at line 66 of mysql_driver.php (assuming CI 2.1.2, I guess).

Normally, you never modify the core files, but the only thing that occurs to me here is to place some strategic var_dumps to see if the function is receiving the correct parameters.

PHP Code:
function db_connect()
 if ($this->port != '')
   $this->hostname .= ':'.$this->port;

  var_dump ($this->hostname$this->username$this->password); exit;

 return @mysql_connect($this->hostname$this->username$this->passwordTRUE);

The values will almost certainly be wrong, but what are they? Finding that out may help you troubleshoot further. And of course, put things back the way they were when you're done. Smile
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!

I think there was an issue with the Loader and environments. If you put a database config file under your current environment (most likely development) then it should work fine.

So: copy the `config/database.php` file and place it in `config/development/database.php`.

Second - what problem were you having signing up at Bonfire's site?

Additionally, was this using one of the Bonfire releases, or using the latest code from the develop branch? On Feb. 10th, I pushed what should be a fix for this:

Quote:Fix #1097, #1081 Installer looks for development database config

Updated installer lib to look for config/ENVIRONMENT/database.php, then
fallback to config/development/database.php and config/database.php.

Note that it will simply load the first one it finds when searching in
this order, so it will still fail if the first of the above is invalid
for the current environment.

Of course, this should only be happening with the installer. I don't think this issue occurs otherwise.

Thank you @RobertSF ,thank you for the excellent suggestion, however the var_dump didn't display anything.@kilishan  I moved the database.php to different environments  and that didn't solve my problem, I tried to signup at BONFIRE forums and it kept giving me this error "Sorry, no account could be found related to the email/username you entered.".@mwhitney I will download the latest version of bonfire with the link you provided, Thanks everyone.

Well guys, I'm so sorry I'm like the dumbest guy.So I did a fresh install of bonfire and realized what was wrong.It had nothing...nothing to do with bonfire.I had created a user for another database and assumed they had privileges to the bonfire database ...they rest ...well you can fill it in .....Bonfire is up and running , but now it wont let me login as admin , I even created a new user and it won't let me login.Help?

Are you getting any errors? What message is displayed when you attempt to login?

I haven't seen any issues in the login code in a while, so I would check the usual culprits:
- make sure your login/password are correct (is caps lock on?)
- are cookies blocked in your browser?
- is some form of caching or some other setting interfering on the server?

Theme © iAndrew 2016 - Forum software by © MyBB