Need help implementing script, db.php error

hospitalshmoo77

New Member
Messages
3
Reaction score
0
Points
0
I'm trying to get this open source thing to work, Installed it as far as i can tell correctly, and this is what i get

Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dashmoo/public_html/functions/system/init.php on line 81

I don't really know anything about this stuff so here is the file that is mentioned

/* We use our own error handling. */
require_once ('./functions/system/errorHandler.php');

/* Include all the functions */
require_once ('./functions/registry.php');

/* Initialize cookies. Mhh, cookies. */
session_start();

/* get the domain name. */
$DOMAIN = $_SERVER[HTTP_HOST];
$SCRIPT = dirname($_SERVER[SCRIPT_NAME]);
$URL = "http://" . $DOMAIN . $SCRIPT;

/* Die and roll over if we use an archaic PHP version. */
if (version_compare(phpversion(), "5.0.0") == "-1") {
die("You are running PHP Version " . phpversion() . ", but at least PHP 5.0.0 is required.<br>" .
"Please upgrade your PHP version and try again.<br>");
}

/* Check that Register globals is OFF */
if (ini_get('register_globals')) {
die("<b>Error:</b> You have register_globals set to on in your php.ini.<br><br> " .
"Not only is this extremly insecure, but even more problematic: " .
"MiningBuddy does not work on hosts with register_globals on. " .
"Turn it off, and try again.");
}

/* Set the error handler. */
set_error_handler('errorHandler', E_WARNING);

/* Do we have the config file? */
if ($_SESSION["initdone"] != true) {
if (!file_exists("./etc/config." . $DOMAIN . ".php")) {
die("Please set up MiningBuddy first by copying /etc/config-release.php " . "to /etc/config." . $DOMAIN . ".php and edit it to suit your needs.");
}
}

/* Include important files. */
require_once ("./etc/config." . $DOMAIN . ".php");

/* is the images cache dir existant and writeable? */
if (!file_exists("./images/cache/" . $DOMAIN)) {
mkdir("./images/cache/" . $DOMAIN, 0755);
}

/* load Pear. */
require_once ('DB.php');
if (!class_exists(DB)) {
die("<b>Error:</b> Unable to load PEAR-DB! It is a requirement. Please add this package, and try again.");
}

/* Config file compatible with this release? */
if ($_SESSION["initdone"] != true) {
if ("$CONF_VER" != "$CONFIGVER") {
die("Your etc/config." . $DOMAIN . ".php file is out of date. Please update it.");
}
elseif ($HAVE_READ != true) {
die("Please edit the configuration file ./etc/config." . $DOMAIN . ".php!");
}
}

/* Create a timestamp and the database - needed before auth! */
$DB = makeDB();
$TIMEMARK = date(U) - (getConfig("timeOffset") * 60 * 60);

/* Create empty user object */
$MySelf = new user(false, false);

/* Lets check if we have the right SQL version */
if ($_SESSION["initdone"] != true) {

global $SQLVER;

// Check the Version information of the Database.
$CURRENT = $DB->getCol("SELECT value FROM config WHERE name = 'version' LIMIT 1");

// NO schema found!
if ($DB->isError($CURRENT)) {
die("Please set up the database first! (See README)");
}

// Version number incorrect.
if ("$CURRENT[0]" < "$SQLVER") {

// Install upgrade.
$filename = "./doc/sql/mysql-update-" . $CURRENT[0] . "-" . ($CURRENT[0] + 1) . ".txt";

// Update the tables.
print ("Your SQL tables are not compatible.<br>");

if (file_exists($filename)) {
die("Please update your sql tables with the sql update file \"$filename\".");
} else {
die("Please update your tables.");
}
}
}

/* Is this call made from within EvE? */
if (ereg("EVE-minibrowser", $_SERVER[HTTP_USER_AGENT])) {

$IGB = TRUE;

// Trust, Inc.
if (getConfig("trustSetting") > 0) {
if ($_SERVER['HTTP_EVE_TRUSTED'] != 'yes') {

// Request Trust
header("eve.trustme:http://" . $DOMAIN . "/::This is " . $VERSION . ".");
ob_flush();
die();

} else {
$EVE_Charname = $_SERVER['HTTP_EVE_CHARNAME'];
}
}
}

/* If we are this far, we have passed the checks. */
if ($_SESSION["initdone"] != true) {
$_SESSION["initdone"] == true;
}

// Load the sitename.
$SITENAME = getConfig("sitename");

global $BLESSED;
if ($BLESSED) {
$VERSION .= " [blessed]";
}

// Ebil MSIE!
//if (!$_SESSION["initdone"] && ereg("MSIE 7", $_SERVER[HTTP_USER_AGENT]) && !isset ($_GET[image])) {
// makeNotice("MiningBuddy does not work with Internet Explorer 7.0 and above. It does work, however with free alternatives like FireFox, Mozilla or Seamonkey - and of course, from in-game. " .
// "<br>- Mozilla: <a href=\"http:/mozilla.org\">mozilla.org</a>" . "<br>- Firefox: <a href=\"http:/mozilla.com\">mozilla.com</a>" .
// "<br>- Seamonkey: <a href=\"http://www.mozilla.org/projects/seamonkey/\">http://www.mozilla.org/projects/seamonkey/</a>", "error", "Browser not supported", " ", " ");
//}

// Update Check!
$UPDATE = checkForUpdate();
?>



It seems DB.php isn't referenced right or something.....I was trying to install this and was supposed to be somewhat easy. Any help would be greatly apprciated.

The files can be downloaded at http://alchemist-industries.com/ind...view=file&id=9:minningbuddy&Itemid=70&lang=en

That is what i'm trying to get to work. Lemme know what else you would need to assist me and thanks in advance =)
 

cashforr

New Member
Messages
10
Reaction score
0
Points
0
you give the link to:
miningbuddy-0.6.tar.zip
File Name: miningbuddy-0.6.tar.zip
File Size: 543.40 kB
Date: 04. September 2010

do you have this error since that date???
 

hospitalshmoo77

New Member
Messages
3
Reaction score
0
Points
0
I just downloaded this and tried to implement it. I've never had it work before. When I unziped the file on my computer and tried to run the index.php file it runs a check basically saying that everythings where it should be. I uploaded it exactly how it is set up just in my www folder and set up the SQL database and thats the error i get



I just found a newer version i will try to upload and get working. Maybe the one I'm using is out of date, not working, and no longer supported. I'll post an update tonight see if it resovles this.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dashmoo/public_html/functions/system/init.php on line 81



Learn to read error messages. They tell you what the problem is.

Failed opening required 'DB.php'

Tried to open a file but couldn't. If you would have included the entire error message, it probably would have said something like "no such file or directory". ie, you are missing a file

in /home/dashmoo/public_html/functions/system/init.php on line 81

This tells you where the error happens. Lines 80-81 are:

/* load Pear. */
require_once ('DB.php');

Your script is trying to load DB.php, which is a PEAR module.

PEAR is not installed on x10hosting. You can install the basic PEAR files and DB.php yourself.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
For sample code, please post only a concise (complete yet minimal) example. Otherwise, there's too much extraneous code to wade through. Please use
PHP:
, [html] or [code] tags (as appropriate) to separate and format code.
 
Top