Post by rgfuelcells » Tue Jun 29, 2021 10:19 am

Hello. I have a website hosted on a Linux server. To test updates I need to run it locally. I have installed XAMPP in my local Windows 10 machine, have downloaded my public_html folder where the website is contained and now I need to run my existing website in XAMPP. I know how to run a new instance of OpenCart. My version is 1.5.6.4.

Do I just have to edit the config.php values? If so how?

Newbie

Posts

Joined
Thu Jun 24, 2021 2:49 am

Post by rjcalifornia » Tue Jun 29, 2021 9:51 pm

rgfuelcells wrote:
Tue Jun 29, 2021 10:19 am
Hello. I have a website hosted on a Linux server. To test updates I need to run it locally. I have installed XAMPP in my local Windows 10 machine, have downloaded my public_html folder where the website is contained and now I need to run my existing website in XAMPP. I know how to run a new instance of OpenCart. My version is 1.5.6.4.

Do I just have to edit the config.php values? If so how?
You need to set up the database, and edit the config.php and admin/config.php. Edit the filesystem paths to OpenCart folders, URLs to OpenCart frontend and admin, and database access details.

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by rgfuelcells » Tue Jun 29, 2021 11:38 pm

rjcalifornia wrote:
Tue Jun 29, 2021 9:51 pm

You need to set up the database, and edit the config.php and admin/config.php. Edit the filesystem paths to OpenCart folders, URLs to OpenCart frontend and admin, and database access details.
For setting up the database I remember following these steps in getting there:
https://studyopedia.com/opencart/how-to ... localhost/

And is this what you meant by editing the filesystem path to OpenCart folders and URLs to OpenCart?

_/config.php
<?php
// HTTP
define('HTTP_SERVER', 'http://localhost/_/');

// HTTPS
define('HTTPS_SERVER', 'http://localhost/_/');

// DIR
define('DIR_APPLICATION', 'C:\xampp\htdocs\_/catalog/');
define('DIR_SYSTEM', 'C:\xampp\htdocs\_/system/');
define('DIR_DATABASE', 'C:\xampp\htdocs\_/system/database/');
define('DIR_LANGUAGE', 'C:\xampp\htdocs\_/catalog/language/');
define('DIR_TEMPLATE', 'C:\xampp\htdocs\_/catalog/view/theme/');
define('DIR_CONFIG', 'C:\xampp\htdocs\_/system/config/');
define('DIR_IMAGE', 'C:\xampp\htdocs\_/image/');
define('DIR_CACHE', 'C:\xampp\htdocs\_/system/cache/');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs\_/download/');
define('DIR_LOGS', 'C:\xampp\htdocs\_/system/logs/');

// DB
define('DB_DRIVER', <DB_DRIVER>);
define('DB_HOSTNAME', <DB_HOSTNAME>);
define('DB_USERNAME', <DB_USERNAME>);
define('DB_PASSWORD', <DB_PASSWORD>);
define('DB_DATABASE', <DB_DATABASE>);
define('DB_PREFIX', <DB_PREFIX>);
?>

_/admin/config.php
<?php
// HTTP
define('HTTP_SERVER', 'http://localhost/_/admin/');
define('HTTP_CATALOG', 'http://localhost/_/');

// HTTPS
define('HTTPS_SERVER', 'http://localhost/_/admin/');
define('HTTPS_CATALOG', 'http://localhost/_/');

// DIR
define('DIR_APPLICATION', 'C:\xampp\htdocs\_/admin/');
define('DIR_SYSTEM', 'C:\xampp\htdocs\_/system/');
define('DIR_DATABASE', 'C:\xampp\htdocs\_/system/database/');
define('DIR_LANGUAGE', 'C:\xampp\htdocs\_/admin/language/');
define('DIR_TEMPLATE', 'C:\xampp\htdocs\_/admin/view/template/');
define('DIR_CONFIG', 'C:\xampp\htdocs\_/system/config/');
define('DIR_IMAGE', 'C:\xampp\htdocs\_/image/');
define('DIR_CACHE', 'C:\xampp\htdocs\_/system/cache/');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs\_/download/');
define('DIR_LOGS', 'C:\xampp\htdocs\_/system/logs/');
define('DIR_CATALOG', 'C:\xampp\htdocs\_/catalog/');

// DB
define('DB_DRIVER', <DB_DRIVER>);
define('DB_HOSTNAME', <DB_HOSTNAME>);
define('DB_USERNAME', <DB_USERNAME>);
define('DB_PASSWORD', <DB_PASSWORD>);
define('DB_DATABASE', <DB_DATABASE>);
define('DB_PREFIX', <DB_PREFIX>);
?>


I changed out some values with angled brackets for security reasons even thought they can only be used in my local drive. My live website host changes the name of the public_html folder to "_" for some reason so that's where the root of my website is in. And should I also be editing .htaccess somehow to run my website in localhost?

Newbie

Posts

Joined
Thu Jun 24, 2021 2:49 am
Who is online

Users browsing this forum: Bing [Bot], stevejonas, StevenPaul and 64 guests