zia Posted January 28, 2004 Share Posted January 28, 2004 The second time I tried to acces the page of the address book, I got this error: Fatal error: Cannot redeclare tep_db_connect() (previously declared in /var/www/html/catalog/includes/functions/database.php:13) in /var/www/html/catalog/includes/functions/database.php on line 13 Any other time I have accessed this page, it appeared as expected with no error. I have never accessed the page noted in the message. What is going on, and how cn I fix it. Please help. Link to comment Share on other sites More sharing options...
coves Posted February 21, 2004 Share Posted February 21, 2004 Looking for help on the same issue! I just blew up my website after spending a few hours on content in the database. I accidentally uploaded a modified index.php file and immediately created this "redeclare" error when I tried to put the original file back up! I had a brain fart, forgt I was working on dynamic pages when I uploaded a small change to index.php that was initially down-loaded using the HTML kit..... By the way, what is the easiest way to modify the look feel of the header and sides of this web template? Fatal error: Cannot redeclare tep_db_connect() (previously declared in /var/www/html/modshop/includes/functions/database.php:13) in /var/www/html/modshop/includes/functions/database.php on line 13 Help, how do we get out of this quickly? Thanks Link to comment Share on other sites More sharing options...
Guest Posted February 21, 2004 Share Posted February 21, 2004 means you have two declarations of tep_db_connect, so remove one from the file you modified or from database.php Link to comment Share on other sites More sharing options...
coves Posted February 21, 2004 Share Posted February 21, 2004 I looked in my home page 'index.php' for a connect string but could not find one. I checked out 'database.php' and did find the connection string. function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; Are you sugesting that I remove this connect statement? If so, where else is it connecting? I am somewhat new at the database side of things, please bare with me... Thanks Link to comment Share on other sites More sharing options...
Guest Posted February 21, 2004 Share Posted February 21, 2004 you can do a search thru all your code for tep_db_connect and see where it is all being called or defined Link to comment Share on other sites More sharing options...
Guest Posted February 21, 2004 Share Posted February 21, 2004 Just in case... one easy way to get a cannot redeclare message is when you back-up a file by calling it something like old_filename.php. The back-up file still gets parsed that way which can cause problems. This is especially true if you try to back-up any of the includes/classes files. It is best to back-up files by naming them something like filename.php.bak or filename.php.lck so that they are not parsed at all. Another possibility is if you accidentally upload the standard file into the includes/languages directory by mistake...can't count how many times I have made that screw-up. :D Link to comment Share on other sites More sharing options...
coves Posted February 21, 2004 Share Posted February 21, 2004 Thanks for your help, did some more digging and ultimately replaced my 'index.php' file (from the original load) to solve the problem. Some minor changes and I'm back in business... Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.