Post by tora0515 » Fri Oct 05, 2012 8:16 am

Trying to move from local host to new server. fresh install worked fine, no problems. When I uploaded my files from localhost mydomain.com/admin comes up with a white screen and mydomain.com produces this error:

Fatal error: Call to a member function get() on a non-object in /home4/pawpostc/public_html/index.php on line 103.

So I took a look at index.php line 103:

Code: Select all

if ($config->get('config_error_display')) {
		echo '<b>' . $error . '</b>: ' . $errstr . ' in <b>' . $errfile . '</b> on line <b>' . $errline . '</b>';
	}
Seems like there is a problem with my config files. So I went and had a look at them. I have gone over them a few times but can not find the mistake, probably missing something, so here are the config files.

config.php (in my root www. folder):

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.pawpost.com.au/');
define('HTTP_IMAGE', 'http://www.pawpost.com.au/image/');
define('HTTP_ADMIN', 'http://www.pawpost.com.au/admin/');

// HTTPS
define('HTTPS_SERVER', 'http://www.pawpost.com.au/');
define('HTTPS_IMAGE', 'http://www.pawpost.com.au/image/');

// DIR
define('DIR_APPLICATION', '/home4/pawpostc/public_html/catalog/');
define('DIR_SYSTEM', '/home4/pawpostc/public_html/system/');
define('DIR_DATABASE', '/home4/pawpostc/public_html/system/database/');
define('DIR_LANGUAGE', '/home4/pawpostc/public_html/catalog/language/');
define('DIR_TEMPLATE', '/home4/pawpostc/public_html/catalog/view/theme/');
define('DIR_CONFIG', '/home4/pawpostc/public_html/system/config/');
define('DIR_IMAGE', '/home4/pawpostc/public_html/image/');
define('DIR_CACHE', '/home4/pawpostc/public_html/system/cache/');
define('DIR_DOWNLOAD', '/home4/pawpostc/public_html/download/');
define('DIR_LOGS', '/home4/pawpostc/public_html/system/logs/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'my user name');
define('DB_PASSWORD', 'my password');
define('DB_DATABASE', 'my database');
define('DB_PREFIX', 'oc_');
?>
admin/config.php:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.pawpost.com.au/admin/');
define('HTTP_CATALOG', 'http://www.pawpost.com.au/');
define('HTTP_IMAGE', 'http://www.pawpost.com.au/image/');

// HTTPS
define('HTTPS_SERVER', 'http://www.pawpost.com.au/admin/');
define('HTTPS_CATALOG', 'http://www.pawpost.com.au/');
define('HTTPS_IMAGE', 'http://www.pawpost.com.au/image/');

// DIR
define('DIR_APPLICATION', '/home4/pawpostc/public_html/admin/');
define('DIR_SYSTEM', '/home4/pawpostc/public_html/system/');
define('DIR_DATABASE', '/home4/pawpostc/public_html/system/database/');
define('DIR_LANGUAGE', '/home4/pawpostc/public_html/admin/language/');
define('DIR_TEMPLATE', '/home4/pawpostc/public_html/admin/view/template/');
define('DIR_CONFIG', '/home4/pawpostc/public_html/system/config/');
define('DIR_IMAGE', '/home4/pawpostc/public_html/image/');
define('DIR_CACHE', '/home4/pawpostc/public_html/system/cache/');
define('DIR_DOWNLOAD', '/home4/pawpostc/public_html/download/');
define('DIR_LOGS', '/home4/pawpostc/public_html/system/logs/');
define('DIR_CATALOG', '/home4/pawpostc/public_html/catalog/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'my user name');
define('DB_PASSWORD', 'my password');
define('DB_DATABASE', 'my database');
define('DB_PREFIX', 'oc_');
?>
Any help on this would be appreciated.

Active Member

Posts

Joined
Fri Jun 15, 2012 3:05 pm

Post by anung » Fri Oct 05, 2012 10:47 pm

Open the system setting, in tan server, check if * Error Log Filename: is right name (error.txt) then try to disable Display Errors: --> save.

User avatar
Active Member

Posts

Joined
Fri Mar 30, 2012 10:32 am
Location - Indonesia

Post by micrdy » Thu Mar 26, 2015 11:25 pm

Have you managed to solve this issue? Got the same

New member

Posts

Joined
Mon Mar 09, 2015 6:40 pm

Post by ibrahim786 » Sun Jun 07, 2015 12:48 am

Hi, I am using opencart v2.0.1.1 i am getting error below

Fatal error: Call to a member function getUserName() on a non-object in /home/appro/public_html/imperial/admin/controller/common/header.php on line 41
$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
above line is default on my public_html how can i fix this problem please help mee!!!!

Newbie

Posts

Joined
Sun Jun 07, 2015 12:45 am

Post by micrdy » Fri Jun 12, 2015 3:03 pm

ibrahim786 wrote:Hi, I am using opencart v2.0.1.1 i am getting error below

Fatal error: Call to a member function getUserName() on a non-object in /home/appro/public_html/imperial/admin/controller/common/header.php on line 41
$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
above line is default on my public_html how can i fix this problem please help mee!!!!
Obviously the object "user" is not avilable. Takte a look here:
http://wiki.opencarthelp.com/doku.php?i ... tfirstname

There you can get the user credentials with $this->customer->get[...]

New member

Posts

Joined
Mon Mar 09, 2015 6:40 pm

Post by sumon » Wed Aug 24, 2016 2:41 pm

Why show this message--- Fatal error: Call to a member function get() on null in C:\xampp\htdocs\shop\system\engine\front.php on line 45

Newbie

Posts

Joined
Wed Aug 24, 2016 2:39 pm
Who is online

Users browsing this forum: No registered users and 40 guests