10

Trying to move from local host to new server. Fresh install worked fine, no problems. When I uploaded my files 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:

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):

<?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:

<?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.

1
  • check permissions(owner:groop) for file system/library/config.php
    – zubovd
    Mar 13, 2014 at 15:58

9 Answers 9

3

I was using opencart and installed vqmod. All of a sudden I have one of the same errors.

This solved my problem: in system/library/session.php replace start session with:

session_save_path(realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../tmp'));
1
  • this is a great solution. Thank you, you saved my day!
    – jiraya85
    Nov 20, 2016 at 0:58
0

The most likely issue is that one or more of your library files are corrupt from uploading. Re upload your system/library/ folder from your local one. Your config files seem fine and the error doesn't reference a config issue. What is line 103 in your index.php file?

4
  • the first code box in the post is line 103. I'll give the library upload a shot.
    – tora0515
    Oct 5, 2012 at 1:34
  • Check pawpost.com.au/index1.php if you can. I uploaded the system/library folder, no change. I will go through each of the files.
    – tora0515
    Oct 5, 2012 at 2:11
  • Check /system/library/config.php and also the index.php file itself to make sure they match exactly. Your error means that $config isn't the object it's meant to be (a Config class) which is generally due to the library file being corrupt Oct 5, 2012 at 9:49
  • I just did a fresh reinstall and am re-entering my database, wasn't that big anyway.
    – tora0515
    Oct 6, 2012 at 7:56
0

please cross check you have set all permissions i had came across this error and was solved, that was due to a file permission problem

0
0

I was struggling with the same problem after migrating my site to a new VPS environment. I figured it HAD to be something to do with the changed document-root path or permissions of my shop and pulled out a lot of hair trying to get to the core of the problem.

I finally realised that I had incorrect permissions on my PHP session-data store! In my case, the folder at /var/lib/php/session/ was owned by apache (naturally) but I had changed apache to run as a different user so it could no longer write to the session-store.

The error messages in this case are cryptic (to say the least!) and didn't give a clue that the problem might just be lack of write permission!

Oh well, we should know by now that 90% of unix issues are down to perms!

0

I upload a file at my server (directory: vqmod/....php ).

Just change vqmod file permission. I set 777 and that solved it.

0

From the error you received, it looks like the $config variable is not getting set. The $config variable is set on line 35 using the Config class which is located in system/library/config.php

I think if you figure out why the class isn't getting instantiated, you'll be able to fix the issue. This could be a couple things:

  • The system/library/config.php file may not have been uploaded to the new server
  • As mentioned in previous answers, there could be a permissions issue. Check the permissions of system/library/config.php and make sure the correct user has ownership.
  • Or it could be a completely unrelated issue.
0

The error is due to permissions set on the cache folder. Setting that to 755 and the files to 555 with set you home and dry.

-1

I had the same issue. I changed vqmod permission to 777. I am not sure this solved the problem, but I checked my website without adding www. before the domain and it worked. The warning was removed if I check http://daytodaystore.com. If I check http://www.daytodaystore.com, the warning is there.

-3

I had this problem when i migrated my server from 2G to 4GH on Godaddy. Came across this forum and found that the issue is with session.php Then, i guessed 'tmp' folder was missing. So, i created one just one step above html folder. and gave it a 777 access. Problem was fixed and my website looks great after that.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.