2022-10-10 13:41:03 - 米境通跨境電商
今天想把opencart搬遷到本地測(cè)試,結(jié)果出現(xiàn)了一堆的錯(cuò)誤,其實(shí)之前沒(méi)搬遷過(guò),并且加上網(wǎng)上沒(méi)這樣的教程,因而我就出來(lái)寫(xiě)寫(xiě)啦!php
第一步,打包下載:mysql
把opencart的程序打包下載,而且導(dǎo)出數(shù)據(jù)庫(kù),數(shù)據(jù)庫(kù)記得要用UTF-8編碼的,不然到時(shí)候確定亂碼sql
第二步,修改文件【重要!】數(shù)據(jù)庫(kù)
首先修改根目錄下的config.php服務(wù)器
里面的內(nèi)容大體以下:編輯器
//HTTP
define('HTTP_SERVER','http://網(wǎng)站域名/');
define('HTTP_IMAGE','http://網(wǎng)站域名/image/');
define('HTTP_ADMIN','http://網(wǎng)站域名/admin/');測(cè)試
//HTTPS
define('HTTPS_SERVER','http://網(wǎng)站域名/');
define('HTTPS_IMAGE','http://網(wǎng)站域名/image/');網(wǎng)站
//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ù)用戶(hù)名');
define('DB_PASSWORD','數(shù)據(jù)庫(kù)密碼');
define('DB_DATABASE','數(shù)據(jù)庫(kù)名');
define('DB_PREFIX','數(shù)據(jù)庫(kù)前綴[這里保持和之前同樣]');
?>spa