2022-09-30 10:15:00 - 米境通跨境電商
今天想把opencart搬遷到本地測(cè)試,結(jié)果出現(xiàn)了一堆的錯(cuò)誤,其實(shí)以前沒(méi)搬遷過(guò),而且加上網(wǎng)上沒(méi)這樣的教程,于是我就出來(lái)寫(xiě)寫(xiě)啦!
第一步,打包下載:
把opencart的程序打包下載,并且導(dǎo)出數(shù)據(jù)庫(kù),數(shù)據(jù)庫(kù)記得要用UTF-8編碼的,否則到時(shí)候肯定亂碼
第二步,修改文件【重要!】
首先修改根目錄下的config.php
里面的內(nèi)容大致如下:
//HTTP
define('HTTP_SERVER','http://網(wǎng)站域名/');
define('HTTP_IMAGE','http://網(wǎng)站域名/image/');
define('HTTP_ADMIN','http://網(wǎng)站域名/admin/');
//HTTPS
define('HTTPS_SERVER','http://網(wǎng)站域名/');
define('HTTPS_IMAGE','http://網(wǎng)站域名/image/');
//DIR
define('DIR_APPLICATION','/網(wǎng)站路徑/catalog/');
define('DIR_SYSTEM','/網(wǎng)站路徑/system/');
define('DIR_DATABASE','/網(wǎng)站路徑/system/database/');
define('DIR_LANGUAGE','/網(wǎng)站路徑/catalog/language/');
define('DIR_TEMPLATE','/網(wǎng)站路徑/catalog/view/theme/');
define('DIR_CONFIG','/網(wǎng)站路徑/system/config/');
define('DIR_IMAGE','/網(wǎng)站路徑/image/');
define('DIR_CACHE','/網(wǎng)站路徑/system/cache/');
define('DIR_DOWNLOAD','/網(wǎng)站路徑/download/');
define('DIR_LOGS','/網(wǎng)站路徑/system/logs/');
//DB
define('DB_DRIVER','mysql');
define('DB_HOSTNAME','127.0.0.1或localhost');
define('DB_USERNAME','數(shù)據(jù)庫(kù)用戶名');
define('DB_PASSWORD','數(shù)據(jù)庫(kù)密碼');
define('DB_DATABASE','數(shù)據(jù)庫(kù)名');
define('DB_PREFIX','數(shù)據(jù)庫(kù)前綴[這里保持和以前一樣]');