Hi,
I have two websites:
I didn't write either but have successfully moved all the files from website1.com to website2.com
I (thought) I installed all the correct php modules and website2 is mostly up and running. However, my boss found that when we go to a particular page;
Okay, so I found where the original DB.php lives and (since I moved ALL the files over) -I made reference to that file. Bad things happened or more explicitly
"DB Error: not found"
Which is strange because the exact same code runs well on website1.com
Anyways, I believe this is a case where the Pear Libraries are in a different location than where the code assumed it to be. One huge hint is that my init.php file has the following string;
<?php ini_set("include_path", ".:./include:/usr/lib/php"); ?>
<?php
require_once 'DB/DataObject.php';
$config = parse_ini_file('db/dataobjects.ini',TRUE);
foreach($config as $class=>$values) {
$options = &PEAR::getStaticProperty($class,'options');
$options = $values;
}
?>
and a general "Find" linux command gives me thus;
-bash-3.2$ find /home/mywebsiteDirectory -name 'DB.php'
/home/mywebsiteDirectory/php/DB.php
/home/mywebsiteDirectory/php/DB/NestedSet/DB.php
/home/mywebsiteDirectory/public_html/dev2/nps/include/DB/DB.php
/home/mywebsiteDirectory/public_html/prod_backup/nps/include/DB/DB.php
/home/mywebsiteDirectory/public_html/include/DB/DB.php
/home/mywebsiteDirectory/public_html/backup/include/DB/DB.php
/home/mywebsiteDirectory/public_html/dev/nps/include/DB/DB.php
/home/mywebsiteDirectory/public_html/dev_experimental/nps5/nps2/include/DB/DB.php
/home/mywebsiteDirectory/public_html/dev_experimental/nps/trunk/include/DB/DB.php
/home/mywebsiteDirectory/public_html/dev_experimental/nps6/include/DB/DB.php
/home/mywebsiteDirectory/public_html/dev_experimental/gcc/emprise/include/DB/DB.php
/home/mywebsiteDirectory/public_html/dev_experimental/nps3/nps/include/DB/DB.php
-bash-3.2$
is there any other string I should add to my include?
do you need any other information to help/
thanks
---------- Post updated at 08:16 PM ---------- Previous update was at 06:34 PM ----------
I'm still stuck on this. Here is the original code which runs fine on website1
require_once 'DB.php';
$db_engine = 'mysql';
$db_user = 'mywebsiteDirectory';
$db_pass = '*********';
$db_host = 'localhost';
$db_name = 'mywebsiteDirectory_testlogin';
$datasource = $db_engine.'://'.
$db_user.':'.
$db_pass.'@'.
$db_host.'/'.
$db_name;
$db_object = DB::connect($datasource, TRUE);
echo $datasource;
/* assign database object in $db_object,
if the connection fails $db_object will contain
the error message. */
// If $db_object contains an error:
// error and exit.
if(DB::isError($db_object)) {
die($db_object->getMessage());
}
$db_object->setFetchMode(DB_FETCHMODE_ASSOC);
// we write this later on, ignore for now.
include('check_login2.php');
?>