Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default server using $_ENV{DATABASE_SERVER} for configure.php database server

    Well, this is a new one for me - amazing how new jobs bring new problems!
    I'm trying to upgrade a 1.3.7 cart on a dedicated server (mediatemple) and the configure files are using $_ENV{DATABASE_SERVER} instead of the name of the database server. I gather this is the only way to get zen cart to work but the upgrade script is very unhappy. They have used a db prefix so I can't easily force the upgrade by just running the sql scripts.

    Is there any way to alter the upgrade scripts to allow for this? Or is there a work around I can use?
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Nov 2004
    Location
    Norfolk, United Kingdom
    Posts
    3,036
    Plugin Contributions
    2

    Default Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

    Starting on Line 70 of zc_install\includes\modules\pages\database_setup\header_php.php(87) you have this code:

    Code:
    if ($is_upgrade) { // read previous settings from configure.php
        $zdb_type       = zen_read_config_value('DB_TYPE');
        $zdb_coll       = zen_read_config_value('DB_CHARSET');
        if ($zdb_coll != 'utf8') $zdb_coll = 'latin1';
        $zdb_prefix     = zen_read_config_value('DB_PREFIX');
        $zdb_server     = zen_read_config_value('DB_SERVER');
        $zdb_user       = zen_read_config_value('DB_SERVER_USERNAME');
        $zdb_pwd        = zen_read_config_value('DB_SERVER_PASSWORD');
        $zdb_name       = zen_read_config_value('DB_DATABASE');
        $zdb_sql_cache  = ($zc_install->getConfigKey('DIR_FS_SQL_CACHE')=='') ? zen_read_config_value('DIR_FS_SQL_CACHE') : $zc_install->getConfigKey('DIR_FS_SQL_CACHE');
        $zdb_cache_type = zen_read_config_value('SQL_CACHE_METHOD');
        $zdb_persistent = zen_read_config_value('USE_PCONNECT');
        $zdb_sessions   = (zen_read_config_value('STORE_SESSIONS')) ? 'true' : 'false';
      } else { // set defaults:
        $zdb_type       = 'MySQL';
        $zdb_coll       = 'latin1';
        $zdb_prefix     = '';
        $zdb_server     = 'localhost';
        $zdb_user       = '';
        $zdb_name       = 'zencart';
        $zdb_sql_cache  = $zc_install->getConfigKey('DIR_FS_SQL_CACHE');
        $zdb_cache_type = 'none';
        $zdb_persistent = 'false';
        $zdb_sessions   = 'true';
      } //endif $is_upgrade
    That's the only code (I believe) that you need to edit for the upgrade of an older version database using the new zc_install, but check your two configure.php files afterwards.

    Vger

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

    very valuable information - Thanks!

    But I must have been wrong because nothing I do works.

    The error message I'm getting is

    Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    I checked and this is cgi php which I've not had had much eperience with.

    I'm about to pull the database to another server to upgrade but I was hoping to find out what's happening here.
    The full-time Zen Cart Guru. WizTech4ZC.com

  4. #4
    Join Date
    Nov 2004
    Location
    Norfolk, United Kingdom
    Posts
    3,036
    Plugin Contributions
    2

    Default Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

    That message normally means that the MySQl service is not running on the server. However you unfortunately signed up with a company which uses a "Grid System" which seems to be unique to them and which no one else (apparently) uses.

    I'm assuming that it's either something like "load balancing" across multiple servers, or else some kind of "cloud" hosting.

    Either way I suspect that no one here would know anything about this "grid system".

    Vger

  5. #5
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

    Good, that means I probably won't run into it again! Thanks for the replies!

    I did go ahead and set up a zen cart on my server and upgraded there then imported it back in. What a pain!

    I believe these folks are getting free hosting from a friend. See what freebies get ya!
    The full-time Zen Cart Guru. WizTech4ZC.com

 

 

Similar Threads

  1. Moving to new server, IP in configure.php?
    By scrap in forum General Questions
    Replies: 8
    Last Post: 14 Apr 2012, 05:35 PM
  2. Database Connectivity - Using a different server
    By ecomuser2010 in forum General Questions
    Replies: 11
    Last Post: 24 Aug 2010, 05:43 AM
  3. configure.php file error on Windows NT server
    By doubletiger in forum Installing on a Windows Server
    Replies: 12
    Last Post: 10 Jul 2006, 03:06 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