We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsosCommerceosCommerce Administration

How to Edit configure.php

Linux KVM Hosting
cPanel KVM
Windows Cloud Server
Germany Cloud Servers
USA VPS
KVM VPS
OpenVZ VPS
Ubuntu VPS
Brazil VPS
Linux Cloud Server

In most cases configure.php needs to be edited when transferring an entire website to another server. It is an essential configuration file as it saves the information about website URL, location in the server and database. If settings are not adjusted accordingly when moving the website, it might stop working properly. In this tutorial we will explain how to edit configure.php and what information it saves.

Follow These Steps to Edit Configure.php

First you should find the file inside osCommerce installation directory. Usually it is located in “includes/configure.php” and “admin/includes/configure.php”. The first one is the configuration for store frontend while the second one is used for admin area configuration. To access these files, you can simply connect to the hosting server through FTP or use available file manager.

As there is basically no difference in frontend and backend configuration files, here we will describe the details of the frontend configure.php file. It starts with the line which defines website URL.

1
define('HTTP_SERVER', 'http://www.example.com');

Another line defines website URL as well, but with secure http.

1
define('HTTPS_SERVER', 'http://www.example.com');

The following line shows whether SSL mode is enabled for checkout procedure. For this mode to be enabled, you might need SSL certificate installed.

1
define('ENABLE_SSL', 'false'); // secure webserver for checkout procedure?

The line defines domain name which will be used in cookies information.

1
define('HTTP_COOKIE_DOMAIN', 'www.example.com');

The same domain as above, just with secure http.

1
define('HTTPS_COOKIE_DOMAIN', 'www.example.com');

The next 2 lines should have the same values as defined in “DIR_WS_HTTP_CATALOG” and “DIR_WS_HTTPS_CATALOG” accordingly.

1
2
define('HTTP_COOKIE_PATH', '//');
define('HTTPS_COOKIE_PATH', '//');

Below you can define the directory in which osCommerce is installed. If installed in public_html, you may leave the default value. However, when using custom directory you may need to put its name.

1
2
define('DIR_WS_HTTP_CATALOG', '//');
define('DIR_WS_HTTPS_CATALOG', '//');

Next lines defines directories for osCommerce and there is not much we can change for them.

1
2
3
4
5
6
7
8
9
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 
define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

One of the important parts is defining the location in which osCommerce is installed. You might need to adjust the following line in order to match current location on the server.

1
2
3
define('DIR_FS_CATALOG', '/home/username/domains/example.com/public_html/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

The final part is to define database details. As usual, it should consist database username, password and the name itself. Also, if your installation resides on the server as well as MySQL server, database server should be “localhost”.

1
2
3
4
5
6
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'username');
define('DB_SERVER_PASSWORD', 'password');
define('DB_DATABASE', 'database');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'mysql');

That is about it for editing configure.php file. As you may have noticed, it is pretty simple to edit this file and adjust various options.

cPanel KVM
OpenVZ VPS
Linux Cloud Server
Windows Cloud Server
USA VPS
Germany Cloud Servers
Linux KVM Hosting
KVM VPS
Ubuntu VPS
Brazil VPS
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment

Other (192)

Popular Keywords