Guest Posted June 9, 2003 Posted June 9, 2003 Hi all! Need some help please! I installed the Customer sort (admin) Contributions, i backed up the customers.php file from Admin prior to this. Anyway installed contrib and now i get a fatal error, see below.... Fatal error: Cannot redeclare tep_db_connect() (previously declared in /usr/local/psa/home/vhosts/upfrontrecords.com.au/httpdocs/store/admin/includes/functions/database.php:13) in /usr/local/psa/home/vhosts/upfrontrecords.com.au/httpdocs/store/admin/includes/functions/database.php on line 13 Can someone help me with this please? I have tried via ftp program to overwrite the customers.php with my backup copy of it as well as delete and reupload orginal file, but i still get this fatal error????? Does someone even know what happened or what this error message means???? Im just a dumb newbie that fuked around with files i shouldn't have i guess!!! So i have learnt my lesson, but can someone shed some light??? Really hope some one can help, as i am way lost...... Thanx to anyone with an idea! Amron
Daemonj Posted June 9, 2003 Posted June 9, 2003 It sounds like you have multiple calls to include the includes/functions/database.php file. "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
Guest Posted June 9, 2003 Posted June 9, 2003 Cool, Cool, Do you have any idea on how to fix it? I am at wits end!!!! Cheers Amron.
Daemonj Posted June 9, 2003 Posted June 9, 2003 Look in your includes/application_top.php file for multiple require(DIR_WS_FUNCTIONS . 'database.php'); and remove all but one of them. "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
Guest Posted June 9, 2003 Posted June 9, 2003 Thank you, thank you for such a quick reply! Ok, now i have had a look, i can only see the one entry so i am not sure exactly what you mean! I notice that there are two application_top.php files, one in catalog/includes and the other in admin/includes. I have copied everything in the admin/includes/application_top.php file below.... Does this file look right?? I only get the error when in the admin side, when i try and click on "Customers" link so i assume its the admin/includes file we need to look at! But i have heard a wise saying. Assumption is the mother of all *edit* ups!! He he!!! <?php /* $Id: application_top.php,v 1.155 2003/02/17 16:54:11 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // Start the clock for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); // Set the level of error reporting error_reporting(E_ALL & ~E_NOTICE); // Check if register_globals is enabled. // Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized. if (function_exists('ini_get')) { ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!'); } // Disable use_trans_sid as tep_href_link() does this manually if (function_exists('ini_set')) { ini_set('session.use_trans_sid', 0); } // Set the local configuration parameters - mainly for developers if (file_exists('includes/local/configure.php')) include('includes/local/configure.php'); // Include application configuration parameters require('includes/configure.php'); // Define the project version define('PROJECT_VERSION', 'Preview Release 2.2-MS1'); // Used in the "Backup Manager" to compress backups define('LOCAL_EXE_GZIP', '/usr/bin/gzip'); define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip'); define('LOCAL_EXE_ZIP', '/usr/local/bin/zip'); define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip'); // define the filenames used in the project define('FILENAME_BACKUP', 'backup.php'); define('FILENAME_BANNER_MANAGER', 'banner_manager.php'); define('FILENAME_BANNER_STATISTICS', 'banner_statistics.php'); define('FILENAME_CACHE', 'cache.php'); define('FILENAME_CATALOG_ACCOUNT_HISTORY_INFO', 'account_history_info.php'); define('FILENAME_CATEGORIES', 'categories.php'); define('FILENAME_CONFIGURATION', 'configuration.php'); define('FILENAME_COUNTRIES', 'countries.php'); define('FILENAME_CURRENCIES', 'currencies.php'); define('FILENAME_CUSTOMERS', 'customers.php'); define('FILENAME_DEFAULT', 'index.php'); define('FILENAME_DEFINE_LANGUAGE', 'define_language.php'); define('FILENAME_FILE_MANAGER', 'file_manager.php'); define('FILENAME_GEO_ZONES', 'geo_zones.php'); define('FILENAME_LANGUAGES', 'languages.php'); define('FILENAME_MAIL', 'mail.php'); define('FILENAME_MANUFACTURERS', 'manufacturers.php'); define('FILENAME_MODULES', 'modules.php'); define('FILENAME_NEWSLETTERS', 'newsletters.php'); define('FILENAME_ORDERS', 'orders.php'); define('FILENAME_ORDERS_INVOICE', 'invoice.php'); define('FILENAME_ORDERS_PACKINGSLIP', 'packingslip.php'); define('FILENAME_ORDERS_STATUS', 'orders_status.php'); define('FILENAME_POPUP_IMAGE', 'popup_image.php'); define('FILENAME_PRODUCTS_ATTRIBUTES', 'products_attributes.php'); define('FILENAME_PRODUCTS_EXPECTED', 'products_expected.php'); define('FILENAME_REVIEWS', 'reviews.php'); define('FILENAME_SERVER_INFO', 'server_info.php'); define('FILENAME_SHIPPING_MODULES', 'shipping_modules.php'); define('FILENAME_SPECIALS', 'specials.php'); define('FILENAME_STATS_CUSTOMERS', 'stats_customers.php'); define('FILENAME_STATS_PRODUCTS_PURCHASED', 'stats_products_purchased.php'); define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php'); define('FILENAME_TAX_CLASSES', 'tax_classes.php'); define('FILENAME_TAX_RATES', 'tax_rates.php'); define('FILENAME_WHOS_ONLINE', 'whos_online.php'); define('FILENAME_ZONES', 'zones.php'); // define the database table names used in the project define('TABLE_ADDRESS_BOOK', 'address_book'); define('TABLE_ADDRESS_FORMAT', 'address_format'); define('TABLE_BANNERS', 'banners'); define('TABLE_BANNERS_HISTORY', 'banners_history'); define('TABLE_CATEGORIES', 'categories'); define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description'); define('TABLE_CONFIGURATION', 'configuration'); define('TABLE_CONFIGURATION_GROUP', 'configuration_group'); define('TABLE_COUNTRIES', 'countries'); define('TABLE_CURRENCIES', 'currencies'); define('TABLE_CUSTOMERS', 'customers'); define('TABLE_CUSTOMERS_BASKET', 'customers_basket'); define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes'); define('TABLE_CUSTOMERS_INFO', 'customers_info'); define('TABLE_LANGUAGES', 'languages'); define('TABLE_MANUFACTURERS', 'manufacturers'); define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info'); define('TABLE_NEWSLETTERS', 'newsletters'); define('TABLE_ORDERS', 'orders'); define('TABLE_ORDERS_PRODUCTS', 'orders_products'); define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes'); define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download'); define('TABLE_ORDERS_STATUS', 'orders_status'); define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history'); define('TABLE_ORDERS_TOTAL', 'orders_total'); define('TABLE_PRODUCTS', 'products'); define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes'); define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download'); define('TABLE_PRODUCTS_DESCRIPTION', 'products_description'); define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications'); define('TABLE_PRODUCTS_OPTIONS', 'products_options'); define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values'); define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options'); define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories'); define('TABLE_REVIEWS', 'reviews'); define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description'); define('TABLE_SESSIONS', 'sessions'); define('TABLE_SPECIALS', 'specials'); define('TABLE_TAX_CLASS', 'tax_class'); define('TABLE_TAX_RATES', 'tax_rates'); define('TABLE_GEO_ZONES', 'geo_zones'); define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones'); define('TABLE_WHOS_ONLINE', 'whos_online'); define('TABLE_ZONES', 'zones'); // customization for the design layout define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125) // Define how do we update currency exchange rates // Possible values are 'oanda' 'xe' or '' define('CURRENCY_SERVER_PRIMARY', 'oanda'); define('CURRENCY_SERVER_BACKUP', 'xe'); // include the database functions require(DIR_WS_FUNCTIONS . 'database.php'); // make a connection to the database... now tep_db_connect() or die('Unable to connect to database server!'); // set application wide parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION . ''); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } // initialize the logger class require(DIR_WS_CLASSES . 'logger.php'); // include shopping cart class require(DIR_WS_CLASSES . 'shopping_cart.php'); // some code to solve compatibility issues require(DIR_WS_FUNCTIONS . 'compatibility.php'); // check to see if php implemented session management functions - if not, include php3/php4 compatible session class if (!function_exists('session_start')) { define('PHP_SESSION_NAME', 'sID'); define('PHP_SESSION_SAVE_PATH', '/tmp'); include(DIR_WS_CLASSES . 'sessions.php'); } // define how the session functions will be used require(DIR_WS_FUNCTIONS . 'sessions.php'); tep_session_name('osCAdminsID'); // lets start our session tep_session_start(); if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, substr(DIR_WS_ADMIN, 0, -1)); } // language require(DIR_WS_FUNCTIONS . 'languages.php'); if ( (!$language) || ($HTTP_GET_VARS['language']) ) { if (!$language) { tep_session_register('language'); tep_session_register('languages_id'); } $language = tep_get_languages_directory($HTTP_GET_VARS['language']); if (!$language) $language = tep_get_languages_directory(DEFAULT_LANGUAGE); } // include the language translations require(DIR_WS_LANGUAGES . $language . '.php'); $current_page = split('?', basename($PHP_SELF)); $current_page = $current_page[0]; // for BadBlue(Win32) webserver compatibility if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) { include(DIR_WS_LANGUAGES . $language . '/' . $current_page); } // define our general functions used application-wide require(DIR_WS_FUNCTIONS . 'general.php'); require(DIR_WS_FUNCTIONS . 'html_output.php'); // define our localization functions require(DIR_WS_FUNCTIONS . 'localization.php'); // setup our boxes require(DIR_WS_CLASSES . 'table_block.php'); require(DIR_WS_CLASSES . 'box.php'); // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; // split-page-results require(DIR_WS_CLASSES . 'split_page_results.php'); // entry/item info classes require(DIR_WS_CLASSES . 'object_info.php'); // email classes require(DIR_WS_CLASSES . 'mime.php'); require(DIR_WS_CLASSES . 'email.php'); // calculate category path $cPath = $HTTP_GET_VARS['cPath']; if (strlen($cPath) > 0) { $cPath_array = explode('_', $cPath); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; } else { $current_category_id = 0; } // default open navigation box if (!tep_session_is_registered('selected_box')) { tep_session_register('selected_box'); $selected_box = 'configuration'; } if ($HTTP_GET_VARS['selected_box']) { $selected_box = $HTTP_GET_VARS['selected_box']; } // the following cache blocks are used in the Tools->Cache section // ('language' in the filename is automatically replaced by available languages) $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true) ); // check if a default currency is set if (!defined('DEFAULT_CURRENCY')) { $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error'); } // check if a default language is set if (!defined('DEFAULT_LANGUAGE')) { $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error'); } ?> If you can help me to get rid of this error, i am more than happy to make a donation to a paypal account of your choice! And would be forever in your debt! Cheers again, Amron. *Please contain your language on these forums* - Johnson
Daemonj Posted June 9, 2003 Posted June 9, 2003 That file looks correct. Have you tried using your old customers.php file to see if the error goes away? "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
Daemonj Posted June 9, 2003 Posted June 9, 2003 My other suggestion would be to re-read the installation instructions to see where you might have missed something or added something extra. "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
Guest Posted June 9, 2003 Posted June 9, 2003 Yeah, i backed up whole site before doing any changes, seeing thou it was only the customers.php file i replaced with the "Customer Sort(admin) contribution, and as soon as i did it, i went into the admin side to see the changes from the contribution, bang, i got the error! So i replaced the new file with my old backup copy while shittin daks that i have broke it, but to no avail! i still got the error! Seeing thou the error makes refrence to the database.php file i also compared the two, old and new that is and i can not see any difference in those files either! Any other suggestions?
Guest Posted June 9, 2003 Posted June 9, 2003 Yeah, i backed up whole site before doing any changes, seeing thou it was only the customers.php file i replaced with the "Customer Sort(admin) contribution, and as soon as i did it, i went into the admin side to see the changes from the contribution, bang, i got the error! So i replaced the new file with my old backup copy while shittin daks that i have broke it, but to no avail! i still got the error! Seeing thou the error makes refrence to the database.php file i also compared the two, old and new that is and i can not see any difference in those files either! Any other suggestions?
Daemonj Posted June 10, 2003 Posted June 10, 2003 Yeah, the problem is not with your database.php file but that another file is trying to load the database.php file twice. Do you only get the message when loading the customer page or on other pages as well? "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
seCret steVe Posted June 10, 2003 Posted June 10, 2003 my suggestion is to redownload oscommerce and reinstall everything to make the problem go away.....will spend less time doing this then trying to find a needle in a hay stack.....sometimes problems are like that....although i cant see where it would be in database.php at all....
Daemonj Posted June 10, 2003 Posted June 10, 2003 my suggestion is to redownload oscommerce and reinstall everything to make the problem go away.....will spend less time doing this then trying to find a needle in a hay stack.....sometimes problems are like that....although i cant see where it would be in database.php at all.... Why download and reinstall when he could just restore his entire backup? "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
seCret steVe Posted June 10, 2003 Posted June 10, 2003 well you can do that as well....i didnt read all the post....just snippets but if he does have a backup then that would be just as good....most people i have dealts with have not had a backup
Daemonj Posted June 10, 2003 Posted June 10, 2003 well you can do that as well....i didnt read all the post....just snippets but if he does have a backup then that would be just as good....most people i have dealts with have not had a backup Yeah, I am familiar with that scene. They are the same type of people that are ridding your arse because they edited their live site and screwed it up and now the site is down. :stupid: Some people deserve to get slapped in the back of the head with a 2x4 sometimes. :twisted: "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
Guest Posted June 10, 2003 Posted June 10, 2003 Yo! Boy am i a happy boy now! Now i am a complete newbie at PHP (3 Months - With no prior code experience!) Ok, found out that i had installed the customers.php file in the /admin/includes/languages/english directory instead of the /admin/ directory! Deleted the file and reinstalled orginal file from my backup. Bingo, it worked! But to be on the safe side, i reinstalled the entire backup of the Admin directory that i did previous to installing the Customer_sort_admin contribution! Normally, i get my Guru mate to install any contributions, but this one just looked so easy i thought i would give it a go! Gotta learn sometime hey?? Well, i did learn bigtime! Thank christ i did hey! Golden rule #1 Backup, Backup, Backup! So problem is all solved, case closed! Strike another one up on the board for... "Yet another newbie thinkin that its all ok, i know what i am doing!" Thank you Daemonj for such quick reply's, even thou eventually i nutted it out myself (good 24hours worth!), you still gave me faith that all was not lost and there was still a chance to save it! Support here is excellent, every day i scour the boards for info and learn more and more. Cheers again to everyone for such a great community, i am sure i will be back soon enuf with more problems looking for some golden wise words of wisdom! Amron....
Daemonj Posted June 10, 2003 Posted June 10, 2003 Glad to hear that you got your problem solved. Have a good one and good luck! :) "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
seCret steVe Posted June 10, 2003 Posted June 10, 2003 happy that the problem is solved. Yeah the golden rule that alot of people do not do is back up. Im glade that you are one of those that do backups..... congrats on your work
Recommended Posts
Archived
This topic is now archived and is closed to further replies.