Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2014
    Location
    United States
    Posts
    4
    Plugin Contributions
    0

    Default found a solution to admin issue on linux install

    This was my first experience with zencart and it was not a good one. However i do understand being a developer myself that sometimes things just go wrong even with the best intentions. However in all my years i have never run into a software that has two config files, one for admin and one for the user side, seems a bit of overkill and i dont see the need.

    Anyway back to the topic on hand.


    So here is what happened and here was my fix as well.


    I installed the script and as soon as i got finished with the admin config page i got a blank page that all it said was that an error had occured. So i looked at the log per instructions and found that the admin table had not been created in the db. Probably becuase it failed im guessing at that point. So i looked at the db and all seemed find except that the admin table was not there.

    So went to the install dir on my pic for the script and went to the sql section and on the very botton of the list there is a file called mysql_zencart. I copied the sql for the admin table (which i have included below for reference) and manually ran the sql via phpMyAdmin to create the table.

    Then i manually put in what info i could and let the system do the rest. BE SURE YOU PUT 1 UNDER THE ADMIN PROFILE FIELD OR YOU WILL NOT HAVE ACCESS TO SUPERADMIN.

    Then i used forgot password to fill in the pw fields and i was off and running when i got signed on.


    HERE ARE THE ISSUES I FOUND WITH THE TABLE...


    The default values on the original are not being accepted by the system. So in order for me to load the table i had to remove all the default values for the dates and a few other items and make them just NOT NULL rather than NOT NULL default = '' or when you used the time and date format i had to remove that as well and just make them all NOT NULL with no default value. So why some of the default values worked some did not and that is why the admin table failed to install. It did give me a small warning about the values when i loaded the table but once i got it loaded and the system took over i think it will be fine now.

    So with that said i think you need to rethink and redo the admin table structure for the install sql. You dont have to have a default value and if you have to then do it correctly please.


    MY EDITED VERSION OF THE SQL
    Code:
    CREATE TABLE IF NOT EXISTS `admin` (
      `admin_id` int(11) NOT NULL AUTO_INCREMENT,
      `admin_name` varchar(32) NOT NULL DEFAULT '',
      `admin_email` varchar(96) NOT NULL DEFAULT '',
      `admin_profile` int(11) NOT NULL DEFAULT '0',
      `admin_pass` varchar(255) NOT NULL DEFAULT '',
      `prev_pass1` varchar(255) NOT NULL DEFAULT '',
      `prev_pass2` varchar(255) NOT NULL DEFAULT '',
      `prev_pass3` varchar(255) NOT NULL DEFAULT '',
      `pwd_last_change_date` datetime DEFAULT NULL,
      `reset_token` varchar(255) NOT NULL DEFAULT '',
      `last_modified` datetime NOT NULL,
      `last_login_date` datetime NOT NULL,
      `last_login_ip` varchar(45) NOT NULL,
      `failed_logins` smallint(4) unsigned NOT NULL DEFAULT '0',
      `lockout_expires` int(11) NOT NULL DEFAULT '0',
      `last_failed_attempt` datetime NOT NULL,
      `last_failed_ip` varchar(45) NOT NULL,
      PRIMARY KEY (`admin_id`),
      KEY `idx_admin_name_zen` (`admin_name`),
      KEY `idx_admin_email_zen` (`admin_email`),
      KEY `idx_admin_profile_zen` (`admin_profile`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
    ORIGINAL FROM THE INSTALL SQL FILE

    Code:
    DROP TABLE IF EXISTS admin;
    CREATE TABLE admin (
      admin_id int(11) NOT NULL auto_increment,
      admin_name varchar(32) NOT NULL default '',
      admin_email varchar(96) NOT NULL default '',
      admin_profile int(11) NOT NULL default '0',
      admin_pass varchar(255) NOT NULL default '',
      prev_pass1 varchar(255) NOT NULL default '',
      prev_pass2 varchar(255) NOT NULL default '',
      prev_pass3 varchar(255) NOT NULL default '',
      pwd_last_change_date datetime NOT NULL default '0000-00-00 00:00:00',
      reset_token varchar(255) NOT NULL default '',
      last_modified datetime NOT NULL default '0000-00-00 00:00:00',
      last_login_date datetime NOT NULL default '0000-00-00 00:00:00',
      last_login_ip varchar(45) NOT NULL default '',
      failed_logins smallint(4) unsigned NOT NULL default '0',
      lockout_expires int(11) NOT NULL default '0',
      last_failed_attempt datetime NOT NULL default '0000-00-00 00:00:00',
      last_failed_ip varchar(45) NOT NULL default '',
      PRIMARY KEY  (admin_id),
      KEY idx_admin_name_zen (admin_name),
      KEY idx_admin_email_zen (admin_email),
      KEY idx_admin_profile_zen (admin_profile)
    ) ENGINE=MyISAM;

    so with that information i ask you to do one thing for me. Please provide me or all of us a correct admin sql so that we get that loaded with the accurate defaults. Or advise us as to where to find a full sql (other than this install file) so that we can reload the whole db structure to be sure that all tables are loaded and all structure is correct.. I dont think that is too much to ask.. do you...

    I hope this solution helps someone with the same issue.

    Thanks for your time. :)

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: found a solution to admin issue on linux install

    Quote Originally Posted by durangod View Post
    However in all my years i have never run into a software that has two config files,
    Seriously? As a developer you must have led a rather sheltered life. <grin>

    Quote Originally Posted by durangod View Post
    one for admin and one for the user side, seems a bit of overkill and i dont see the need.
    One word. "Security".

    By having a separate config file for the admin section means that the location of the admin files will/should never be leaked to the public side of things.

    Quote Originally Posted by durangod View Post
    The default values on the original are not being accepted by the system.
    Exactly what were the error messages being reported? (This is mainly out of curiosity).

    Quote Originally Posted by durangod View Post
    So in order for me to load the table i had to remove all the default values for the dates and a few other items and make them just NOT NULL rather than NOT NULL default = '' or when you used the time and date format i had to remove that as well and just make them all NOT NULL with no default value. So why some of the default values worked some did not and that is why the admin table failed to install. It did give me a small warning about the values when i loaded the table but once i got it loaded and the system took over i think it will be fine now.

    So with that said i think you need to rethink and redo the admin table structure for the install sql. You dont have to have a default value and if you have to then do it correctly please.
    So, just for grins, I copied BOTH of the SQL codes that you posted here and ran them on a test DB, and NEITHER of them had any problems or errors.

    Quote Originally Posted by durangod View Post
    so with that information i ask you to do one thing for me. Please provide me or all of us a correct admin sql so that we get that loaded with the accurate defaults. Or advise us as to where to find a full sql (other than this install file) so that we can reload the whole db structure to be sure that all tables are loaded and all structure is correct.. I dont think that is too much to ask.. do you...
    The thing is, if this were a common problem I think it would be safe to assume that it would have been reported and fixed long before your attempted installation.

    Quote Originally Posted by durangod View Post
    I hope this solution helps someone with the same issue.
    I can't dispute your findings/solution, but since your experience is apparently the exception rather than the rule, it could probably be worth investigating why the original code is causing a problem for you and not almost everyone else.

    Sometimes us developers can be too smart for our own good and end up coding around a problem that shouldn't exist in the 1st place. ;-)

    Cheers
    RodG

    ps. I'm not part of the ZenCart dev team, but over the years I've lost count of how many ZenCart install and updates I've performed.

  3. #3
    Join Date
    Oct 2014
    Location
    United States
    Posts
    4
    Plugin Contributions
    0

    Default Re: found a solution to admin issue on linux install

    I do not dissagree with you, you do make some valid points. However i think the list of those that dont have double configs would be much longer than those that do. I also agree about developers coding around issues as hotfixes rather than addressing the issue directly. The first thing i do when i find a new script to use is i run Agent Ransack and do some searches. One thing i look for is mysqli or pdo. If all i find is mysql but no 'i' library functions the script goes in the trash right then and there. Now on the double configs just to be clear i never said it was wrong, i said i didnt see the need and thati had not run into that before. Understand that other very popular scripts just off the top of my head, open source and not. phpbb, coppermine, whmcs, oxwall, wordpress, none of them have double configs. And WHMCS although not open source just uses the main config to redirect the renamed admin folder.

    So its not that i have led a sheltered life its that it could be as i attempted to state (badly i might add and i apologize for that) that the benefit is not worth the extra support, documentation, or security in order to do so. So maybe i just have not seen that before, i would think if it was the mother of all security then more scripts would use it, that sounds logical too me. I suppose that we can just leave it at developers prerogative and agree to disagree and im ok with that. Again i did not mean to come off as it was wrong per se.


    Back to the error issue. Just fyi, (exception of one) i can install any of the list above and not have one issue with the install of any of them.

    I change the admin to admintest on the sql as to not overwright my real table and here is what it says.




    SQL query:


    CREATE TABLE admintest (
    admin_id int(11) NOT NULL auto_increment,
    admin_name varchar(32) NOT NULL default '',
    admin_email varchar(96) NOT NULL default '',
    admin_profile int(11) NOT NULL default '0',
    admin_pass varchar(255) NOT NULL default '',
    prev_pass1 varchar(255) NOT NULL default '',
    prev_pass2 varchar(255) NOT NULL default '',
    prev_pass3 varchar(255) NOT NULL default '',
    pwd_last_change_date datetime NOT NULL default '0000-00-00 00:00:00',
    reset_token varchar(255) NOT NULL default '',
    last_modified datetime NOT NULL default '0000-00-00 00:00:00',
    last_login_date datetime NOT NULL default '0000-00-00 00:00:00',
    last_login_ip varchar(45) NOT NULL default '',
    failed_logins smallint(4) unsigned NOT NULL default '0',
    lockout_expires int(11) NOT NULL default '0',
    last_failed_attempt datetime NOT NULL default '0000-00-00 00:00:00',
    last_failed_ip varchar(45) NOT NULL default '',
    PRIMARY KEY (admin_id),
    KEY idx_admin_name_zen (adm[...]



    MySQL said: Documentation
    #1067 - Invalid default value for 'pwd_last_change_date'

    and it continues to every single date format default




    And this is the sql

    Code:
    CREATE TABLE admintest (
      admin_id int(11) NOT NULL auto_increment,
      admin_name varchar(32) NOT NULL default '',
      admin_email varchar(96) NOT NULL default '',
      admin_profile int(11) NOT NULL default '0',
      admin_pass varchar(255) NOT NULL default '',
      prev_pass1 varchar(255) NOT NULL default '',
      prev_pass2 varchar(255) NOT NULL default '',
      prev_pass3 varchar(255) NOT NULL default '',
      pwd_last_change_date datetime NOT NULL default '0000-00-00 00:00:00',
      reset_token varchar(255) NOT NULL default '',
      last_modified datetime NOT NULL default '0000-00-00 00:00:00',
      last_login_date datetime NOT NULL default '0000-00-00 00:00:00',
      last_login_ip varchar(45) NOT NULL default '',
      failed_logins smallint(4) unsigned NOT NULL default '0',
      lockout_expires int(11) NOT NULL default '0',
      last_failed_attempt datetime NOT NULL default '0000-00-00 00:00:00',
      last_failed_ip varchar(45) NOT NULL default '',
      PRIMARY KEY  (admin_id),
      KEY idx_admin_name_zen (admin_name),
      KEY idx_admin_email_zen (admin_email),
      KEY idx_admin_profile_zen (admin_profile)
    ) ENGINE=MyISAM;

    so what i need to do is find out why it does not like that structure. If i discover anything i post back here with the results.
    Last edited by durangod; 4 Oct 2014 at 06:58 PM.

  4. #4
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: found a solution to admin issue on linux install

    What version of MySQL (and is it on the Zen Cart compatibility list)? I seem to remember a conversation regarding changing the default dates in a future Zen Cart release to add support for changes in newer versions of MySQL...

    As for having two configure files, I suspect this was done to allow flexibility for the location of the administrative system. For example one could place the administearive code on a different subdomain / server. Having them separate also means if the main site was compromised, the admin location would not necessarily be leaked...

  5. #5
    Join Date
    Oct 2014
    Location
    United States
    Posts
    4
    Plugin Contributions
    0

    Default Re: found a solution to admin issue on linux install

    Thank you all for the opportunity. I have had a chance to dig into the meat of this today, and i think im going to pass on the script at least for now.

    1. i was looking to just toss a few digital products online in much of a plug and play type deal. I did not realize how time consuming this would be.
    2. If i write my own deal i dont have to worry about upgrades, connection issues, paypal IPN issues that im reading about now and all of that. No versions it just runs every time the same way.
    3. I dont like being so dependent on a script i dont know that well to be a flawless sales process for my company.
    4. I respect the fact that this is free and so i certainly cant complain about that. And i do thank the developers for what they do and what they created, but maybe you can have something like a zencart mini version without all the bells and whistles. Maybe 5 min setup and go, Maybe just a theme editor and a few products and let us do the transaction inside papal as we normally do, just let us display our digital products but let paypal do the rest. I would feel more secure that way.
    5. If i had 50+ products it would probably be worth the time and other vestment as i do think you do some nice things with features. But for my 6 items probably not more than 20 in my lifetime (unless i add other product types) the work and maintenance does not justify itself, at least for me.

    So again i do thank you and i will certainly return should things change. But ill just code my own IPN page and write my own PHP to capture the sale and download the digital goods myself.

    Thanks so much :) peace and good luck to all

  6. #6
    Join Date
    Oct 2014
    Location
    United States
    Posts
    4
    Plugin Contributions
    0

    Default Re: found a solution to admin issue on linux install

    Quote Originally Posted by lhungil View Post
    What version of MySQL (and is it on the Zen Cart compatibility list)? I seem to remember a conversation regarding changing the default dates in a future Zen Cart release to add support for changes in newer versions of MySQL...

    As for having two configure files, I suspect this was done to allow flexibility for the location of the administrative system. For example one could place the administearive code on a different subdomain / server. Having them separate also means if the main site was compromised, the admin location would not necessarily be leaked...

    yes that makes sense honestly i didnt think about having the admin on a different server, that is a nice feature and would justify the two configs for sure, thanks for pointing that out. Just fyi.. .mysql 5.5 and php 5.4.31

  7. #7
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: found a solution to admin issue on linux install

    Quote Originally Posted by durangod View Post
    yes that makes sense honestly i didnt think about having the admin on a different server, that is a nice feature and would justify the two configs for sure, thanks for pointing that out.
    Yet another possibility for this is the ZenCart was based on the OsCommerce code (which also has the two config files) so the *real* reason for it is unknown to the ZenCart developers, but since it has several potential benefits there has never been a need/reason to adopt a single config file system.

    Quote Originally Posted by durangod View Post
    Just fyi.. .mysql 5.5 and php 5.4.31
    Also just a FYI, the code(s) you posted earlier both worked fine on my test DB running MySQL V5.5.38.
    I do/also suspect that the issue is somehow related to MySQL versions though.

    Cheers
    RodG

  8. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: found a solution to admin issue on linux install

    Quote Originally Posted by RodG View Post
    The thing is, if this were a common problem I think it would be safe to assume that it would have been reported and fixed long before your attempted installation.
    Quote Originally Posted by RodG View Post
    I can't dispute your findings/solution, but since your experience is apparently the exception rather than the rule, it could probably be worth investigating why the original code is causing a problem for you and not almost everyone else.
    **nods in agreement with both of these statements**

    OMG Rod!!! I think we've become sympatico!!!! **lol**

    Quote Originally Posted by RodG View Post
    I'm not part of the ZenCart dev team, but over the years I've lost count of how many ZenCart install and updates I've performed.
    Yep and in all those years I have only had one ODD A$$ED issue install/operation issue with Zen Cart which LIKELY had to do with my client's host conversion from PHP 5.3.x to PHP 5.4.. I NEVER found the EXACT cause.. (try as I might..) I ended up re-building the site from scratch on the dev server and promoting it to the live site.. POOF problem gone.. Other than that.. never had one issue that didn't come down to a user error or a RTFM error on my part..

    These days I'm pushing the envelope with Zen Cart and WordPress integration stuff (shared theme/template stuff). If ANYTHING was gonna break Zen Cart, and integration with another CMS would certainly do the trick, and I am STILL not having issues.. The OPs issues sound very unique to his installation/server config/etc..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #9
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: found a solution to admin issue on linux install

    Quote Originally Posted by durangod View Post
    Paypal IPN issues that im reading about now and all of that
    The ONLY folks having PayPal IPN issues are those using the PayPal module that NO ONE should be using.. PayPal IPN issues are a NON-ISSUE using the PayPal Express module..

    My point is, it sounds like you are "hearing it through the grapevine", and you are either reading posts that are DOG OLD or referring to versions of Zen Cart that are DOG OLD.. IJS...

    BTW, my own Zen Cart site is exactly what you say you want.. a few downloadable items (free and commercial) and PayPal to handle the payment transactions.. Simple.. Took me 10 minutes to install, 1 day to add the products & order the SSL cert (not required for payment since the PayPal Express runs on PayPal's site.. I just wanted to secure the checkout pages), 1 day to integrate with the WordPress part of my site so Zen Cart and WordPress looked alike, and that was it..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 

Similar Threads

  1. new install but admin not found
    By christinefred in forum Installing on a Windows Server
    Replies: 8
    Last Post: 28 Feb 2015, 12:47 AM
  2. install/transfer issue on Linux
    By alekt in forum Installing on a Linux/Unix Server
    Replies: 14
    Last Post: 10 Oct 2007, 10:58 PM
  3. Not Found error in admin area, new install
    By albannach in forum Installing on a Linux/Unix Server
    Replies: 10
    Last Post: 19 Feb 2007, 12:49 PM
  4. linux install issue?
    By ary in forum General Questions
    Replies: 10
    Last Post: 9 Jan 2007, 02:08 AM

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