We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.13.4.12. Generic OpenCart config files

Data config files simplify the site transfer process:

  • File config.php (located in root directory site):
    config.php
    <?php
    // HTTP
    $host = $_SERVER['HTTP_HOST'];
    define('HTTP_SERVER', 'http://' . $host. '/');
     
    // HTTPS
    define('HTTPS_SERVER', 'https://' . $host. '/');
     
    // DIR
    $dir = dirname(__FILE__);
    define('DIR_APPLICATION', $dir . '/catalog/');
    define('DIR_SYSTEM', $dir . '/system/');
    define('DIR_IMAGE', $dir . '/image/');
    define('DIR_STORAGE', DIR_SYSTEM . 'storage/');
    define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
    define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
    define('DIR_CONFIG', DIR_SYSTEM . 'config/');
    define('DIR_CACHE', DIR_STORAGE . 'cache/');
    define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
    define('DIR_LOGS', DIR_STORAGE . 'logs/');
    define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
    define('DIR_SESSION', DIR_STORAGE . 'session/');
    define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
     
    // DB
    define('DB_DRIVER', 'mysqli');
    define('DB_HOSTNAME', 'example.mysql.tools');
    define('DB_USERNAME', 'example_db');
    define('DB_PASSWORD', 'password');
    define('DB_DATABASE', 'example_db');
    define('DB_PORT', '3306');
    define('DB_PREFIX', 'oc_');
  • File config.php (located in the subdirectory admin):
    config.php
    <?php
    // HTTP
    $host = $_SERVER['HTTP_HOST'];
    define('HTTP_SERVER', 'http://' . $host. '/admin/');
    define('HTTP_CATALOG', 'http://' . $host. '/');
     
    // HTTPS
    define('HTTPS_SERVER', 'https://' . $host. '/admin/');
    define('HTTPS_CATALOG', 'https://' . $host. '/');
     
    // DIR
    $dir = dirname(dirname(__FILE__));
    define('DIR_APPLICATION', $dir . '/admin/');
    define('DIR_SYSTEM', $dir . '/system/');
    define('DIR_IMAGE', $dir . '/image/');
    define('DIR_STORAGE', DIR_SYSTEM . 'storage/');
    define('DIR_CATALOG', $dir . '/catalog/');
    define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
    define('DIR_TEMPLATE', DIR_APPLICATION . 'view/template/');
    define('DIR_CONFIG', DIR_SYSTEM . 'config/');
    define('DIR_CACHE', DIR_STORAGE . 'cache/');
    define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
    define('DIR_LOGS', DIR_STORAGE . 'logs/');
    define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
    define('DIR_SESSION', DIR_STORAGE . 'session/');
    define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
     
    // DB
    define('DB_DRIVER', 'mysqli');
    define('DB_HOSTNAME', 'example.mysql.tools');
    define('DB_USERNAME', 'example_db');
    define('DB_PASSWORD', 'password');
    define('DB_DATABASE', 'example_db');
    define('DB_PORT', '3306');
    define('DB_PREFIX', 'oc_');
     
    // OpenCart API
    define('OPENCART_SERVER', 'https://www.opencart.com/');