Post by Kukac » Mon Dec 11, 2023 7:01 pm

Hello,
I am new to the backend stuff and I just want to make some front end changes to this site. And when trying to run the site I get this error

Fatal error: Uncaught Error: Class "DB" not found in C:\xampp\htdocs\servis\web\index.php:35 Stack trace: #0 {main} thrown in C:\xampp\htdocs\servis\web\index.php on line 35

The site is using Opencart 2.0.2.0 at least I think so...

The lines contain this code:

Code: Select all

$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$registry->set('db', $db);
Can someone please help me figure out this error.
For your help Thanks.

PS: I hope I'm posting this in the correct thread

Newbie

Posts

Joined
Mon Dec 11, 2023 6:52 pm

Post by paulfeakins » Mon Dec 11, 2023 8:08 pm

Kukac wrote:
Mon Dec 11, 2023 7:01 pm
C:\xampp\htdocs\servis\web\index.php on line 35
This might not be the cause of the problem but I wouldn't recommend developing on Windows.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JNeuhoff » Mon Dec 11, 2023 11:23 pm

Check your config.php and admin/config.php, to make sure all the paths and DB details are correctly set.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Kukac » Mon Dec 18, 2023 3:24 pm

I figured it out and now I have this error.
Parse error: syntax error, unexpected 'object' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in C:\xampp7-1\htdocs\servis\web\system\library\db.php on line 17

Opencart 2.0.2.0
I am using xampp
I tried these versions of xampp.
8.0
7.1
5.6
5.3

Newbie

Posts

Joined
Mon Dec 11, 2023 6:52 pm

Post by JNeuhoff » Mon Dec 18, 2023 6:34 pm

If you really want some help here you have to provide some more details, such as OC version, extensions used, etc. One thing is for sure: Yours doesn't appear to be OpenCart 2.0.2.0, because the latter wouldn't cause this error, because the complaint about line 17 only contains a closing '}' bracket.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Kukac » Mon Dec 18, 2023 7:49 pm

How can I check my opencart version?
I have vqmod installed too but I don't know mutch more I just got the files to make som frontend changes

Newbie

Posts

Joined
Mon Dec 11, 2023 6:52 pm

Post by paulfeakins » Wed Dec 20, 2023 8:22 pm

Kukac wrote:
Mon Dec 18, 2023 7:49 pm
How can I check my opencart version?
https://www.antropy.co.uk/blog/how-do-i ... i-m-using/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 22 guests