Help and support

Where is the OpenCart configuration file?

The configuration file serves for the initial setup of the site on the OpenCart engine, the main function of which is to connect the site to the database.

The file itself is called config.php and is located in the root directory of the site, as well as in the admin directory, the absolute path to which you can find out in your control panel

 define('DB_HOSTNAME', ' ̲  '); define('DB_USERNAME', '  '); define('DB_PASSWORD', '   '); define('DB_DATABASE', '  '); define('DB_PORT', '3306'); define('DB_PREFIX', 'Բ ');

A feature of OpenCart is the same usage the absolute URL of the domain , which will be used globally in the engine

 define('HTTP_SERVER', 'https://DOMAIN_NAME/'); define('HTTPS_SERVER', 'https://DOMAIN_NAME/');

for admin/config.php :

 define('HTTP_SERVER', 'https://DOMAIN_NAME/admin/'); define('HTTP_CATALOG', 'https://DOMAIN_NAME/'); // HTTPS define('HTTPS_SERVER', 'https://DOMAIN_NAME/admin/'); define('HTTPS_CATALOG', 'https://DOMAIN_NAME/');

when enabling and setting up redirection to https in your control panel using the instructions, it is important to specify the https protocol in the values of the HTTP_SERVER and HTTPS_SERVER variables;
two more environment variables are used in the configuration file for the admin panel: HTTP_CATALOG and HTTPS_CATALOG;

Also, when moving the site, you must correctly specify the absolute paths to the modules of the CMS itself:

 define('DIR_APPLICATION', '/var/www/HOSTING_LOGIN/www/DOMAIN_NAME/catalog/'); define('DIR_SYSTEM', '/var/www/HOSTING_LOGIN/www/DOMAIN_NAME/system/'); define('DIR_IMAGE', '/var/www/HOSTING_LOGIN/www/DOMAIN_NAME/image/'); define('DIR_STORAGE', '/var/www/HOSTING_LOGIN/www/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/');
HOSTING_LOGIN - the name of your hosting account;
DOMAIN_NAME - the name of your domain;
DIR_STORAGE - OpenCart itself requires security to move the storage directory outside the scope of the directory with the main site. In this example, the storage directory is moved to a level above the site directory, into a directory with all sites. details here : [link to instructions]