v156c to PHP8.2

Views: 7,368

Results 1 to 11 of 11
9 Nov 2024, 2:57 PM
#1
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

v156c to PHP8.2

Hello!

My very old server in Debian 10 and back-ported PHP5.6.40 is reaching the end of its life (SSDs dying) and my only upgrade hosting option is Debian 12 with PHP8.2...

I have a v1.5.6c running fine with good ol' PHP5 but it's time to upgrade... I tried running it straight on PHP8.2 and I can only get a blank screen, somehow the base class fails to load silently.

So... from your past experience, what would be a possible upgrade path?
Should I upgrade to ZC 2.0+ directly?
Should I go through a local PHP7 validation path to upgrade to 1.5.8 first?

What would make sense?

10 Nov 2024, 6:53 AM
#2
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: v156c to PHP8.2

generikz:

Hello!

My very old server in Debian 10 and back-ported PHP5.6.40 is reaching the end of its life (SSDs dying) and my only upgrade hosting option is Debian 12 with PHP8.2...

I have a v1.5.6c running fine with good ol' PHP5 but it's time to upgrade... I tried running it straight on PHP8.2 and I can only get a blank screen, somehow the base class fails to load silently.

So... from your past experience, what would be a possible upgrade path?
Should I upgrade to ZC 2.0+ directly?
Should I go through a local PHP7 validation path to upgrade to 1.5.8 first?

What would make sense?

It can depend on what plugins etc you used in 1.5.6, but basically I would install zc2 on your new server, then replace the sample database with your old database and run the install again to upgrade the database and you should then have a vanilla zen cart 2 running with your data.

10 Nov 2024, 10:56 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: v156c to PHP8.2

@Royaldave is right - a two step upgrade is a waste of time.

Be sure to review the upgrading docs at

https://docs.zen-cart.com/user/upgrading/

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

13 Nov 2024, 5:23 PM
#4
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: v156c to PHP8.2

Thank you for the feedback.

Will give the v1.5.6c => 2.0+ update a try and report if about the process (in case I hit/fix a few bumps along the road).

All in DEV environment so I can break things without entering panic mode.

20 Nov 2024, 2:54 PM
#5
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: v156c to PHP8.2

Baby steps!

First steps tonight were to get zc_install to be happy with all PHP8.2 extensions before trying an upgrade.

Took me a while to remember that CURL and INTL required the PATH to PHP to be set at the system level on Windows 10 (so that Apache can find it) and not at the DOS level (where PHP CLI was not having any issue).

Database upgrade went smoothly from to 1.5.7 => 1.5.8 => 2.0.

Then the main page was blank...

But tracing back where PHP was failing pointed to HEADER_TITLE_CATALOG in includes\init_includes\init_add_crumbs.php

And then I remembered that my sister's Store is in French!

After adding French Language Pack for ZC v2+, I finally reached the main page with no error.

Of course none of the plugins/customization are included back as of yet, but now I know there is a working path to upgrade the database + language when this part will be ready.

The admin section is also throwing a blank screen, will advance further there to see what modification might have broken it.

20 Nov 2024, 4:09 PM
#6
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: v156c to PHP8.2

generikz:

The admin section is also throwing a blank screen, will advance further there to see what modification might have broken it.

Was only because, although I set SSL to false, the PHP extension=openssl was still required otherwise:

PHP Fatal error:  Uncaught Error: Call to undefined function openssl_random_pseudo_bytes()

Attachment 20801

Very impressed by how easy the base upgrade from v1.5.6c to v2.0.1 is.

Looking at the dates... it seems that I force myself to perform a full version upgrade/catch-up every 7 years :shocking:

Congrats to all the ZC code contributors, you can see how far back this ZC has been upgraded from and it's still working as expected!

5 Apr 2025, 1:25 PM
#7
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: v156c to PHP8.2

I actually updated the DB all the way to v2.1.0.

But I have an issue login in with existing Cart.

PHP Fatal error:  Uncaught Error: Undefined constant "SHOW_SHOPPING_CART_COMBINED" in (...)\includes\modules\pages\login\header_php.php:97

I can see SHOW_SHOPPING_CART_COMBINED is not new since 1.5.6c and was likely a DB configuration entry, maybe it was dropped from the DB when updated?

Julien

5 Apr 2025, 1:55 PM
#8
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: v156c to PHP8.2

generikz:

I actually updated the DB all the way to v2.1.0.

But I have an issue login in with existing Cart.

PHP Fatal error: Uncaught Error: Undefined constant "SHOW_SHOPPING_CART_COMBINED" in (...)\includes\modules\pages\login\header_php.php:97

> 
> I can see **SHOW_SHOPPING_CART_COMBINED** is not new since 1.5.6c and was likely a DB configuration entry, maybe it was dropped from the DB when updated?
> 
> Julien

that constant was added in v138.

you can re-add it using the following sql statement, but i would be suspicious that there are other problems with your database.

as to, "it was dropped when updated?" i see nothing in the code that would do such a thing.

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show Notice of Combining Shopping Cart on Login', 'SHOW_SHOPPING_CART_COMBINED', '1', 'When a customer logs in and has a previously stored shopping cart, the products are combined with the existing shopping cart.<br /><br />Do you wish to display a Notice to the customer?<br /><br />0= OFF, do not display a notice<br />1= Yes show notice and go to shopping cart<br />2= Yes show notice, but do not go to shopping cart', '9', '35', 'zen_cfg_select_option(array('0', '1', '2'), ', now());


that is from [here.](https://github.com/zencart/zencart/blob/e8fa966b8f0a4ebe31918c34b2283769fb8435d3/zc_install/sql/install/mysql_zencart.sql#L2811-L2812C681)

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

5 Apr 2025, 1:58 PM
#9
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: v156c to PHP8.2

I ended up parsing the ZC install SQL code and found the entry that must have been missing from the DB from a very old version.

Added manually, it's working again now.

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show Notice of Combining Shopping Cart on Login', 'SHOW_SHOPPING_CART_COMBINED', '1', 'When a customer logs in and has a previously stored shopping cart, the products are combined with the existing shopping cart.<br /><br />Do you wish to display a Notice to the customer?<br /><br />0= OFF, do not display a notice<br />1= Yes show notice and go to shopping cart<br />2= Yes show notice, but do not go to shopping cart', '9', '35', 'zen_cfg_select_option(array(\'0\', \'1\', \'2\'), ', now());

Then updated configuration_title and configuration_description to French from the FR Pack on configuration_group_id= 9 and sort_order = 35.

For some reason, v1.5.6c was working just fine without it.

Julien

5 Apr 2025, 3:19 PM
#10
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: v156c to PHP8.2

carlwhat:

that constant was added in v138.

you can re-add it using the following sql statement, but i would be suspicious that there are other problems with your database.

Since I started ZC from 1.3.8 maybe I used an early version that was missing that entry?

I did add it back manually -- checking that previous and following entries in ZC 2.1.0 SQL install script were present -- and things are working.
1.5.6c didn't require it at client log on but on 2.1.0 it's required.

All good now.

Julien

16 Apr 2025, 12:52 AM
#11
nldav avatar

nldav

New Zenner

Join Date:
Jan 2005
Posts:
55
Plugin Contributions:
0

Re: v156c to PHP8.2

generikz:

Looking at the dates... it seems that I force myself to perform a full version upgrade/catch-up every 7 years :shocking:

Hmm

Attachment 20946