Reputation: 91
I have taken a copy of an OpenCart installation (version 2.0.3.1) and put on to Windows localhost.
I've fixed a couple of the issues, but I've now come up against an error that I can't resolve:
Fatal error: Class 'Config' not found in ..\index.php on line 31
I've searched Google, but no-one else seems to have come across the same problem.
Can someone tell me where this class resides?
The relevant lines in the index.php file are:
CODE:
23 // Registry
24 $registry = new Registry();
25
26 // Loader
27 $loader = new Loader($registry);
28 $registry->set('load', $loader);
29
30 // Config
31 $config = new Config(); // HERE
32 $registry->set('config', $config);
Upvotes: 3
Views: 7871
Reputation: 849
I got this error - but it was due to me adding config.php to my .gitignore file.
I only wanted to ignore my settings files but this caused the config.php class file to also be ignored from the /system/library folder (same name!)
just make sure that config.php exists in the library folder - but make sure it contains config class - not your oc settings!
Upvotes: 5
Reputation: 86
I faced the same issue while integrating it on the local machine. Follow these steps, it might help:-
Also, make sure you have written something like this on top of index file or not require_once('config.php');
I hope this helps.
Upvotes: 4