Jump to content
MakeWebGames

Db exception in admin panel


balea17

Recommended Posts

Hey guys,

I just tried to install ezRPG again, works great like always. There's only one thing that's really bugging me and which I can't really comprehend at the moment.

When I click on the admin button I get the following message:

Error: DbException!

File: D:\xampp\htdocs\ezrpg\lib\class.dbfactory.php

Line: 52

Could not find driver:

Stack Trace:

#0 D:\xampp\htdocs\ezrpg\init.php(31): DbFactory::factory(NULL, NULL, NULL, NULL, NULL)

#1 D:\xampp\htdocs\ezrpg\admin\index.php(4): require_once('D:\xampp\htdocs...')

#2 {main}

Tried to fix it and can't figure out what I'm missing here.. never had this happen before. It only happens when I try to visit the admin panel, everything else works as intended so far.

A little pointer in the right direction to fixing this error would be very appreciated.

Link to comment
Share on other sites

Replace your init.php with the following if you use xampp:

<?php
//This page cannot be viewed, it must be included
defined('IN_EZRPG') or exit;

//Start Session
session_start();

//Headers
//header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past


//Show errors?

//Constants
define('CUR_DIR', realpath(dirname(__FILE__)));
define('MOD_DIR', CUR_DIR . '/modules');
define('ADMIN_DIR', CUR_DIR . '/admin');
define('LIB_DIR', CUR_DIR . '/lib');
define('EXT_DIR', LIB_DIR . '/ext');
define('HOOKS_DIR', CUR_DIR . '/hooks');

require_once CUR_DIR.'/config.php';
(SHOW_ERRORS == 0)?error_reporting(0):error_reporting(E_ALL);

require_once(CUR_DIR . '/lib.php');

//Database
try
{
   $db = DbFactory::factory($config_driver, $config_server, $config_username, $config_password, $config_dbname);
}
catch (DbException $e)
{
   $e->__toString();
}

//Database password no longer needed, unset variable
unset($config_password);


//HTML Purifier Config
$purifier_config = HTMLPurifier_Config::createDefault();
$purifier_config->set('HTML.Allowed', 'b,a[href],i,br,em,strong,ul,li');
$purifier_config->set('URI.Base', $_SERVER['DOCUMENT_ROOT']);
$purifier_config->set('URI.MakeAbsolute', true);
$purifier_config->set('URI.DisableExternal', true);
$purifier = new HTMLPurifier($purifier_config);


//Smarty
$tpl = new Smarty();
$tpl->template_dir = CUR_DIR . '/smarty/templates/';
$tpl->compile_dir  = CUR_DIR . '/smarty/templates_c/';
$tpl->config_dir   = CUR_DIR . '/smarty/configs/';
$tpl->cache_dir    = CUR_DIR . '/smarty/cache/';

//Initialize $player
$player = 0;

//Create a hooks object
$hooks = new Hooks($db, $tpl, $player);

//Include all hook files
$hook_files = scandir(HOOKS_DIR);

foreach($hook_files as $hook_file)
{
   $path_parts = pathinfo(HOOKS_DIR . '/' . $hook_file);
   if ($path_parts['extension'] == 'php' && $path_parts['basename'] != 'index.php')
       include_once (HOOKS_DIR . '/' . $hook_file);
}

//Run login hooks on player variable
$player = $hooks->run_hooks('player', 0);
?>
Link to comment
Share on other sites

Read the post above yours spud.

For some reason zeggy just did include config.php even though init.php is being included from a different directory (so some configurations of php were trying to load ezrpg/admin/config.php), so i fixed it by using the CUR_DIR constant in the include path.

Link to comment
Share on other sites

  • 3 weeks later...

yeh i guess its fixable...and probably booher did fix it but...i remember that i quit using Xampp after i had that problem...didnt realize the problem. So i downloaded another wamp similiar things and it worked well on those. Atm im using Ampps and i dont have that problem. Its probably how Xampp reads ezrpg code probably.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...