I have setup opencart store at locahost, after which I uploaded all the materials to online hosting and changed the paths in the config.php file in the root folder and admin folder.
The front is working fine, but the admin side is not working. It just shows a blank white page.
I am debugging the My Index.php file, placing the echo in some places by the echo numbers to check if it is running to this point or not.
I tried to solve this error. I updated the file code indicated here. One change: My Log recently created this error -
PHP Fatal error: Call to a member function isLogged() on a non-object in /var/www/html/home/catalog/model/catalog/product.php on line 8
I also give code for my product.php
So he gives an error on this line below - $ controller-> dispatch ($ action, new Action ('error / not_found'));
I also included the Index.php file.
My Config.php page in the admin folder: -
<?php define('HTTP_SERVER', 'http://domain/home/admin/'); define('HTTP_CATALOG', 'http://domain/home/'); // HTTPS define('HTTPS_SERVER', 'http://domain/home/admin/'); define('HTTPS_CATALOG', 'http://domain/home/'); echo '1'; // DIR define('DIR_APPLICATION', '/var/www/html/home/catalog/'); define('DIR_SYSTEM', '/var/www/html/home/system/'); define('DIR_DATABASE', '/var/www/html/home/system/database/'); define('DIR_LANGUAGE', '/var/www/html/home/admin/language/'); define('DIR_TEMPLATE', '/var/www/html/home/admin/view/template/'); define('DIR_CONFIG', '/var/www/html/home/system/config/'); define('DIR_IMAGE', '/var/www/html/home/image/'); define('DIR_CACHE', '/var/www/html/home/system/cache/'); define('DIR_DOWNLOAD', '/var/www/html/home/download/'); define('DIR_LOGS', '/var/www/html/home/system/logs/'); define('DIR_CATALOG', '/var/www/html/home/catalog/'); echo '2'; // DB define('DB_DRIVER', 'mysql'); define('DB_HOSTNAME', 'localhost'); define('DB_USERNAME', 'username'); define('DB_PASSWORD', 'password'); define('DB_DATABASE', 'databasename'); define('DB_PREFIX', 'oc_'); echo '3'; ?>
.Php Code Index
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE); ?> <?php // Version define('VERSION', '1.5.6'); // Configuration if (file_exists('config.php')) { require_once('config.php'); } echo '4'; // Install if (!defined('DIR_APPLICATION')) { header('Location: ../install/index.php'); exit; } // Startup require_once(DIR_SYSTEM . 'startup.php'); echo '5'; // Application Classes require_once(DIR_SYSTEM . 'library/currency.php'); require_once(DIR_SYSTEM . 'library/user.php'); require_once(DIR_SYSTEM . 'library/weight.php'); require_once(DIR_SYSTEM . 'library/length.php'); echo '6'; // Registry $registry = new Registry(); echo '7'; // Loader $loader = new Loader($registry); $registry->set('load', $loader); echo '7'; // Config $config = new Config(); $registry->set('config', $config); echo '8'; // Database $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE); $registry->set('db', $db); echo '9'; // Settings $query = $db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE store_id = '0'"); echo '10'; foreach ($query->rows as $setting) { if (!$setting['serialized']) { $config->set($setting['key'], $setting['value']); } else { $config->set($setting['key'], unserialize($setting['value'])); } } echo '11'; // Url $url = new Url(HTTP_SERVER, $config->get('config_secure') ? HTTPS_SERVER : HTTP_SERVER); $registry->set('url', $url); echo '12'; // Log $log = new Log($config->get('config_error_filename')); $registry->set('log', $log); echo '13'; function error_handler($errno, $errstr, $errfile, $errline) { global $log, $config; switch ($errno) { case E_NOTICE: case E_USER_NOTICE: $error = 'Notice'; break; case E_WARNING: case E_USER_WARNING: $error = 'Warning'; break; case E_ERROR: case E_USER_ERROR: $error = 'Fatal Error'; break; default: $error = 'Unknown'; break; } if ($config->get('config_error_display')) { echo '<b>' . $error . '</b>: ' . $errstr . ' in <b>' . $errfile . '</b> on line <b>' . $errline . '</b>'; } if ($config->get('config_error_log')) { $log->write('PHP ' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line ' . $errline); } return true; } echo '14'; // Error Handler set_error_handler('error_handler'); // Request $request = new Request(); $registry->set('request', $request); // Response $response = new Response(); $response->addHeader('Content-Type: text/html; charset=utf-8'); $registry->set('response', $response); // Cache $cache = new Cache(); $registry->set('cache', $cache); // Session $session = new Session(); $registry->set('session', $session); // Language $languages = array(); $query = $db->query("SELECT * FROM `" . DB_PREFIX . "language`"); foreach ($query->rows as $result) { $languages[$result['code']] = $result; } $config->set('config_language_id', $languages[$config->get('config_admin_language')]['language_id']); // Language $language = new Language($languages[$config->get('config_admin_language')]['directory']); $language->load($languages[$config->get('config_admin_language')]['filename']); $registry->set('language', $language); echo '15'; // Document $registry->set('document', new Document()); // Currency $registry->set('currency', new Currency($registry)); // Weight $registry->set('weight', new Weight($registry)); // Length $registry->set('length', new Length($registry)); // User $registry->set('user', new User($registry)); //OpenBay Pro $registry->set('openbay', new Openbay($registry)); $registry->set('play', new Play($registry)); $registry->set('ebay', new Ebay($registry)); $registry->set('amazon', new Amazon($registry)); $registry->set('amazonus', new Amazonus($registry)); // Front Controller $controller = new Front($registry); echo '16'; // Login $controller->addPreAction(new Action('common/home/login')); echo '17'; // Permission $controller->addPreAction(new Action('common/home/permission')); echo '18'; // Router if (isset($request->get['route'])) { $action = new Action($request->get['route']); } else { $action = new Action('common/home'); } echo '19'; // Dispatch $controller->dispatch($action, new Action('error/not_found')); echo '20'; // Output $response->output(); echo '21'; ?>
Line 8 - Line 13 In Product.php Where this error comes from
if ($this->customer->isLogged()) { $customer_group_id = $this->customer->getCustomerGroupId(); } else { $customer_group_id = $this->config->get('config_customer_group_id'); }