2022-09-30 09:51:12 - 米境通跨境電商
今天想把opencart搬遷到本地測試,結(jié)果出現(xiàn)了一堆的錯誤,其實(shí)以前沒搬遷過,而且加上網(wǎng)上沒這樣的教程,于是我就出來寫寫啦!
第一步,打包下載:
把opencart的程序打包下載,并且導(dǎo)出數(shù)據(jù)庫,數(shù)據(jù)庫記得要用UTF-8編碼的,否則到時候肯定亂碼
第二步,修改文件【重要!】
首先修改根目錄下的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ù)庫用戶名');
define('DB_PASSWORD','數(shù)據(jù)庫密碼');
define('DB_DATABASE','數(shù)據(jù)庫名');
define('DB_PREFIX','數(shù)據(jù)庫前綴[這里保持和以前一樣]');
?>
網(wǎng)站路徑比如“/home/wwwroot/yiju/”或“D:/AppServ/www/yiju/”其中yiju是我在網(wǎng)站服務(wù)器下建立的網(wǎng)站根目錄。