Post by leighwilles » Wed Oct 23, 2024 12:35 pm

Trying to upgrade from 3.0.X.X to 4.0.2.3 because when server PHP upgraded from 7.6 to 8.1 and OC3.X no longer works without many errors.

This is a basic installation of OC with no fancy extensions just the basic store front.

As instructed I backed up system files and DB before action. Uploaded all 4.X to server except config.php and admin/config.php

Opened OC expecting the Upgrade prompt but this message comes up:

Fatal error: Uncaught Error: Undefined constant "APPLICATION" in /home/beginanew2015/public_html/somersethomemade.com/shmph/system/framework.php:4 Stack trace: #0 /home/beginanew2015/public_html/somersethomemade.com/shmph/admin/index.php(20): require_once() #1 {main} thrown in /home/beginanew2015/public_html/somersethomemade.com/shmph/system/framework.php on line 4

I have looked for help and found a few that sort of show possible answers but nothing seems to fit this error or, if it does, I cannot see how to fix.

I have tried to open OC using both latest Firefox and latest Chrome on a Windows platform with the same error message received.

I am not an expert but can follow basic logic.

Can anyone assist with a solution?

Newbie

Posts

Joined
Fri May 21, 2021 9:26 pm

Post by OSWorX » Wed Oct 23, 2024 3:47 pm

leighwilles wrote:
Wed Oct 23, 2024 12:35 pm
Trying to upgrade from 3.0.X.X to 4.0.2.3 because when server PHP upgraded from 7.6 to 8.1 and OC3.X no longer works without many errors.
Worst idea ever!
leighwilles wrote:
Wed Oct 23, 2024 12:35 pm
Can anyone assist with a solution?
Yes, use this here: https://github.com/opencart/opencart/re ... ag/3.0.4.0
This version works with php 8.x without any problem.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by leighwilles » Wed Oct 23, 2024 5:44 pm

I appreciate the reply with the link to precious items but none appear to contain the key components for the error message I am receiving:

Newbie

Posts

Joined
Fri May 21, 2021 9:26 pm

Post by leighwilles » Wed Oct 23, 2024 5:49 pm

the error message I am receiving suggests a missing parameter in an important file that when added will result in the Upgrade function but I cannot determine the parameter (possibly APPLICATION) in what format, nor which file (framework.php ro index.php) . . . to repeat the error message: Fatal error: Uncaught Error: Undefined constant "APPLICATION" in /home/beginanew2015/public_html/somersethomemade.com/shmph/system/framework.php:4 Stack trace: #0 /home/beginanew2015/public_html/somersethomemade.com/shmph/admin/index.php(20): require_once() #1 {main} thrown in /home/beginanew2015/public_html/somersethomemade.com/shmph/system/framework.php on line 4

Newbie

Posts

Joined
Fri May 21, 2021 9:26 pm

Post by by mona » Wed Oct 23, 2024 5:59 pm

As you said you are not an expert.
As has been stated. At this time it is not recommended to use OC4 for live sites. Your error is not relevant to that answer as you will find out very quickly that there will be more errors that will make your site very expensive to get fixed by experts. Your site do as you wish.

APPLICATION is set in the config.php files. I guess you did not update correctly.
How did you update?
3.0.x.x is compatible with php8, presuming you mean 3.0.x.x and not some random OC3 version that you want to keep secret?
I have looked for help and found a few that sort of show possible answers but nothing seems to fit this error or, if it does, I cannot see how to fix.
like what?

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by JNeuhoff » Wed Oct 23, 2024 10:37 pm

Your main goal is to achieve PHP 8.x compatibility, and to have a stable website. Therefore, you should use OpenCart 3.0.4.0 which supports all PHP 8.x versions, and OpenCart 3.0.4.0, unlike OpenCart 4, is also stable enough for live sites.

If you provide more details, e.g. your old OC version, extensions, theme, etc, then we can help you here with your upgrade. In most cases installing a fresh OC 3.0.4.0 with the same theme and extensions (provided the latter are 3.0.4.0-compatible) is the best approach. You can then use the Export/Import tool to copy over your data, see also our FAQ on this.

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 leighwilles » Thu Oct 24, 2024 7:39 pm

the reason I chose to upgrade to OC4.X was because there was an error showing immediately after the PHP upgrade to 8.1 when using the OC3.X version - it was impossible for visitors to complete the filling out of their address when registering a new account and it was impossible to complete an online order so, as I could not find a solution to that error, I decided to upgrade. If that action was an error then I need to go back and find the cause of the 3.x error and downgrade . . . I originally installed OC3.X in November of 2020 and did nothing to it after that because it worked.

If the error now showing is because a line of code related to the location / specification of 'APPLICATION' is the only problem then I have copies of the original config.php files and can make the edit but I need to know what & where to type and in which of the two config.php files the edit should take place, e.g. is it in the root config.php or in the admin/config.php or is it in both? I am hoping that someone could guide me in this instance to resolve the problem. If not then I will have to reevaluate what software to use for this application.

Newbie

Posts

Joined
Fri May 21, 2021 9:26 pm

Post by khnaz35 » Thu Oct 24, 2024 7:42 pm

I recommend switching to OC 3.0.4.0 instead of upgrading to OC 4.x.

Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by OSWorX » Thu Oct 24, 2024 11:45 pm

leighwilles wrote:
Thu Oct 24, 2024 7:39 pm
If the error now showing is because a line of code related to the location / specification of 'APPLICATION' is the only problem then I have copies of the original config.php files and can make the edit but I need to know what & where to type and in which of the two config.php files the edit should take place, e.g. is it in the root config.php or in the admin/config.php or is it in both?
As already written by many others: don't use 4.x, better 3.0.4.0 - reasons because why you will find here in this forum ..
Basically 4.x is not stable enough for a production environement!

Back to your question:

1. config.php in root:

Code: Select all

define('DIR_APPLICATION', DIR_OPENCART . 'catalog/');
2. config in admin/:

Code: Select all

define('DIR_APPLICATION', DIR_OPENCART . 'admin/');
Both after the line has DIR_OPENCART in it.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 3 guests