Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    3
    Plugin Contributions
    0

    application error Fatal error Cannot redeclare class

    Hi everyone, good day.

    We have had a new template and all the site was working just fine, but we wanted to install some add's, one of them is shopmania...

    I'm able to enter the admin area, but unable to see the store front (which gives error code 500), I was attempting to put shopmania's code on my site and I wanted to set it on the index.php, so I opened the file and pasted the code they gave me, but at the end I deleted it (leaving all the file like was before editing) because the store owner just wanted the banners made for the site.
    Contacted hosting provider about the error code 500, they said maybe in the .htcaccess was modified the .php or .html, we didn't editted the htcaccess, so this was no that helpful.
    I also updated the file datafeed_shopmania_zencart.php in the directory which is suposed to be uploaded (meaning www. importamx .com/Tienda this is were our store is installed), and it work fine.
    The store can be seen if the site is put on maintenance.

    I have checked the debug log and it shows:

    PHP Fatal error: include() [<a href='function.include'>function.include</a>]: Cannot redeclare class base in /home/content/54/10372554/html/Tienda/includes/autoload_func.php on line 60

    I have searched into the Developers Tool Kit and I got:

    Searching 1307 files ... for: autoload_func.php
    /home/content/54/10372554/html/Tienda/our_admin_folder_name/includes/application_top.php
    Line #146 : require(DIR_FS_CATALOG . 'includes/autoload_func.php');
    /home/content/54/10372554/html/Tienda/includes/application_top.php
    Line #139 : if (( (!file_exists('includes/configure.php') && !file_exists('includes/local/configure.php')) ) || (DB_TYPE == '') || (!file_exists('includes/classes/db/' .DB_TYPE . '/query_factory.php')) || !file_exists('includes/autoload_func.php')) {
    Line #140 : $problemString = 'includes/configure.php file empty or file not found, OR wrong DB_TYPE set, OR cannot find includes/autoload_func.php which suggests paths are wrong or files were not uploaded correctly';
    Line #148 : require('includes/autoload_func.php');
    /home/content/54/10372554/html/Tienda/includes/autoload_func.php
    Line #12 : * @version $Id: autoload_func.php 14141 2009-08-10 19:34:47Z wilt $
    Match Lines found: 5
    Zencart v 1.5.1
    MySQL 5.0
    PHP 5.3.24
    The web is importamx .com

    Summarizing:

    The file datafeed_shopmania_zencart.php has been loaded in to the store file root
    The index.php has left like was before editing
    Restoration of DB has been set to a point 23 hours ago (didn't help).
    Compared autoload_fun.php with zencart's original and the one in the site.
    Compared configure.php files
    Compared index.php files

    Thank you in advance.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error Cannot redeclare class

    What are the differences when you compare *everything* ... ie: ALL files, not just 3.
    What files are missing?
    What files are extra?
    http://www.zen-cart.com/wiki/index.p...Obscure_Issues
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2009
    Posts
    3
    Plugin Contributions
    0

    Default Re: Fatal error Cannot redeclare class

    Hi, DrByte.

    I executed WinMerge and it shows several extra and different files, although I still can't find what is causing the error.

    Equal files:
    download, editors, extras, logs, media, pub.

    Report attached.
    informe.zip

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error Cannot redeclare class

    You need to look at all the files in your /includes/ folder and subfolders. Delete any extra files that don't belong. Remove changes to changed files that don't belong.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Feb 2009
    Posts
    3
    Plugin Contributions
    0

    Default Re: Fatal error Cannot redeclare class

    Hi again.

    The extra and different files in the includes folder are the ones modified for the custom template, I have been checking file by file (though maybe I have missed something). The problem still persist, so I have set the store under maintenance (the way still shows the front store), while I'll upload a new zencart (tested in localhost) to replace the broken one.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error Cannot redeclare class

    Quote Originally Posted by sasha21 View Post
    I have checked the debug log and it shows:

    PHP Fatal error: include() [function.include]: Cannot redeclare class base in /home/content/54/10372554/html/Tienda/includes/autoload_func.php on line 60

    I have searched into the Developers Tool Kit and I got:
    Searching 1307 files ... for: autoload_func.php
    That was the wrong search.
    The filename in which the error occurred is only the "messenger", not necessarily the actual error.

    In your case, your site is somehow loading the /includes/classes/class.base.php file multiple times. That could be caused by having files actually trying to load that specific file (which should never be necessary), or by you making duplicates of other files when renaming them to "make backups", or by you adding code that re-runs the autoload_func script multiple times.

    About the "renaming to make backups" comment: NEVER rename "something.php" to "somethingelse.php" in order to make a backup! Change the ".php" part, not the filename part. So "something.php" should be renamed to "something.bak" or "something.php1" or "something.old" or "something.php-old", etc.
    Zen Cart automatically loads all "*.php" files in many folders just by virtue of their existence. So if you rename and "old one" but keep the ".php" on the end, you're not actually stopping the "old one" from being used, but instead you're making it be run TWICE ... which will often result in errors similar to the symptoms you're reporting.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Fatal error: Cannot redeclare class base
    By apovey in forum General Questions
    Replies: 3
    Last Post: 25 Jun 2009, 05:08 AM
  2. Fatal error: Cannot redeclare class paypal
    By ridelow in forum General Questions
    Replies: 3
    Last Post: 1 Nov 2008, 10:07 AM
  3. Fatal error: Cannot redeclare class moneyorder
    By bekinky in forum Customization from the Admin
    Replies: 2
    Last Post: 10 Mar 2007, 07:51 PM
  4. Fatal error: Cannot redeclare class paypal
    By lorhan in forum General Questions
    Replies: 4
    Last Post: 29 Jul 2006, 03:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR