Post by joaodias117 » Sat Apr 27, 2019 3:20 am

Recentemente eu importei os arquivos de meu site para a máquina que estou utilizando atualmente e tive que configurar os arquivos php para os caminhos corretos, para assim conseguir rodar ele no localhost, pelo XAMPP.

Porém, quando tento acessar o site, ocorre o seguinte erro:
Notice: Error: Could not load config default! in C:\xampp\htdocs\shop\system\library\config.php on line 27

Estes são os arquivos config.php do root e admin\config.php com os caminhos que estou utilizando:

-config.php

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://localhost/shop/');

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

// DIR
define('DIR_APPLICATION', 'C:\xampp\htdocs\shop\admin');
define('DIR_SYSTEM', 'C:\xampp\htdocs\shop\system');
define('DIR_IMAGE', 'C:\xampp\htdocs\shop\image');
define('DIR_LANGUAGE', 'C:\xampp\htdocs\shop\admin\language');
define('DIR_TEMPLATE', 'C:\xampp\htdocs\shop\admin\view\template');
define('DIR_CONFIG', 'C:\xampp\htdocs\shop\system\config');
define('DIR_CACHE', 'C:\xampp\htdocs\shop\system\storage\cache');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs\shop\system\storage\download');
define('DIR_LOGS', 'C:\xampp\htdocs\shop\system\storage\logs');
define('DIR_MODIFICATION', 'C:\xampp\htdocs\shop\system\storage\modification');
define('DIR_UPLOAD', 'C:\xampp\htdocs\shop\system\storage\upload');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'xxxx.umbler.com');
define('DB_USERNAME', 'xxxx');
define('DB_PASSWORD', 'xxxx');
define('DB_DATABASE', 'xxxx');
define('DB_PORT', 'xxxx');
define('DB_PREFIX', 'oc_');

-admin\config.php

Code: Select all

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


// HTTPS
define('HTTPS_SERVER', 'http://localhost/shop/');
define('HTTP_CATALOG', 'https://localhost/shop/');

// DIR
define('DIR_APPLICATION', 'C:\xampp\htdocs\shop\admin/');
define('DIR_SYSTEM', 'C:\xampp\htdocs\shop\system');
define('DIR_IMAGE', 'C:\xampp\htdocs\shop\image/');
define('DIR_LANGUAGE', 'C:\xampp\htdocs\shop\admin\language/');
define('DIR_TEMPLATE', 'C:\xampp\htdocs\shop\admin\view\template/');
define('DIR_CONFIG', 'C:\xampp\htdocs\shop\system\config/');
define('DIR_CACHE', 'C:\xampp\htdocs\shop\system\storage\cache/');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs\shop\system\storage\download/');
define('DIR_LOGS', 'C:\xampp\htdocs\shop\system\storage\logs/');
define('DIR_MODIFICATION', 'C:\xampp\htdocs\shop\system\storage\modification/');
define('DIR_UPLOAD', 'C:\xampp\htdocs\shop\system\storage\upload/');
define('DIR_CATALOG', 'C:\xampp\htdocs\shop\catalog/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'xxxx.umbler.com');
define('DB_USERNAME', 'xxxx');
define('DB_PASSWORD', 'xxxx');
define('DB_DATABASE', 'xxxx');
define('DB_PORT', 'xxxx');
define('DB_PREFIX', 'oc_');


-E este é o arquivo system\library\config.php

Code: Select all

<?php
class Config {
	private $data = array();

	public function get($key) {
		return (isset($this->data[$key]) ? $this->data[$key] : null);
	}

	public function set($key, $value) {
		$this->data[$key] = $value;
	}

	public function has($key) {
		return isset($this->data[$key]);
	}

	public function load($filename) {
		$file = DIR_CONFIG . $filename . '.php';

		if (file_exists($file)) {
			$_ = array();

			require($file);

			$this->data = array_merge($this->data, $_);
		} else {
			trigger_error('Error: Could not load config ' . $filename . '!');
			exit();
		}
	}
}


Alguém poderia me ajudar, por favor? Preciso resolver este problema o quanto antes.

Agradeço desde já a ajuda.

Newbie

Posts

Joined
Sat Apr 27, 2019 2:53 am

Post by IP_CAM » Sat Apr 27, 2019 10:22 pm

Try this:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://localhost/shop/admin/');
define('HTTP_CATALOG', 'http://localhost/shop/');
---

Code: Select all

define('DIR_APPLICATION', 'C:\xampp\htdocs\shop\admin\');
define('DIR_SYSTEM', 'C:\xampp\htdocs\shop\system\');
define('DIR_IMAGE', 'C:\xampp\htdocs\shop\image\');
define('DIR_LANGUAGE', 'C:\xampp\htdocs\shop\admin\language\');
define('DIR_TEMPLATE', 'C:\xampp\htdocs\shop\admin\view\template\');
define('DIR_CONFIG', 'C:\xampp\htdocs\shop\system\config\');
define('DIR_CACHE', 'C:\xampp\htdocs\shop\system\storage\cache\');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs\shop\system\storage\download\');
define('DIR_LOGS', 'C:\xampp\htdocs\shop\system\storage\logs\');
define('DIR_MODIFICATION', 'C:\xampp\htdocs\shop\system\storage\modification\');
define('DIR_UPLOAD', 'C:\xampp\htdocs\shop\system\storage\upload\');
or this:

Code: Select all

define('DIR_APPLICATION', 'C:\xampp\htdocs\shop\admin\/');
define('DIR_SYSTEM', 'C:\xampp\htdocs\shop\system\/');
define('DIR_IMAGE', 'C:\xampp\htdocs\shop\image\/');
define('DIR_LANGUAGE', 'C:\xampp\htdocs\shop\admin\language\/');
define('DIR_TEMPLATE', 'C:\xampp\htdocs\shop\admin\view\template\/');
define('DIR_CONFIG', 'C:\xampp\htdocs\shop\system\config\/');
define('DIR_CACHE', 'C:\xampp\htdocs\shop\system\storage\cache\/');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs\shop\system\storage\download\/');
define('DIR_LOGS', 'C:\xampp\htdocs\shop\system\storage\logs\/');
define('DIR_MODIFICATION', 'C:\xampp\htdocs\shop\system\storage\modification\/');
define('DIR_UPLOAD', 'C:\xampp\htdocs\shop\system\storage\upload\/');
Ernie

I'm rarely still active at the OC Forum. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.ipcam.li/shop/
---
1'000+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 4 guests