Zen Cart Logo
Forums / Upgrading to 1.5.x / ZC 1.57d PHP 8.0 compatibility to what extent?

ZC 1.57d PHP 8.0 compatibility to what extent?

Views: 3,426

Results 1 to 12 of 12
21 May 2022, 2:01 PM
#1
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
163
Plugin Contributions:
0

ZC 1.57d PHP 8.0 compatibility to what extent?

Just spent time upgrade one of my shopping cart from ZC 1.55f php 7.3 to ZC 1.57d with PHP 8.1
I have notice the following pattern:
ZC 1.57d seems to run flawlessly on Php 7.4. Its basic cart, so it doesnt really throw log entries at all, not even warnings or deprivation notices.

However up on upgrading to PHP 8.0 (and even 8.1) , ZC 1.57d throws a whole lot of warnings. The warnings looks like they are from ZC core files.
Is this a known issue with when running ZC 1.57d with PHP 8.0? Is there a way to temporarily suppress the warnings, as I don't think php.ini affects ZC log files?

Thanks.


Index page:

#1 require_once(/home/zencart/includes/init_includes/init_sessions.php) called at [/home/zencart/includes/autoload_func.php:37]
#2 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#3 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "SSL_SESSION_ID" in /home/zencart/includes/init_includes/init_sessions.php on line 132.

[21-May-2022 06:29:50 America/Los_Angeles] Request URI: /, IP address: xxx.xxx.xxx.xxx
#1 products_viewed_counter->should_be_excluded() called at [/home/zencart/includes/classes/observers/class.products_viewed_counter.php:17]
#2 products_viewed_counter->__construct() called at [/home/zencart/includes/autoload_func.php:44]
#3 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#4 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "spider_flag" in /home/zencart/includes/classes/observers/class.products_viewed_counter.php on line 37.

Load any category:
[21-May-2022 06:47:13 America/Los_Angeles] Request URI: /index.php?main_page=index&cPath=21, IP address: xxx.xxx.xxx.xxx
#1 require_once(/home/zencart/includes/init_includes/init_sessions.php) called at [/home/zencart/includes/autoload_func.php:37]
#2 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#3 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "SSL_SESSION_ID" in /home/zencart/includes/init_includes/init_sessions.php on line 132.

[21-May-2022 06:47:13 America/Los_Angeles] Request URI: /index.php?main_page=index&cPath=21, IP address: xxx.xxx.xxx.xxx
#1 products_viewed_counter->should_be_excluded() called at [/home/zencart/includes/classes/observers/class.products_viewed_counter.php:17]
#2 products_viewed_counter->__construct() called at [/home/zencart/includes/autoload_func.php:44]
#3 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#4 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "spider_flag" in /home/zencart/includes/classes/observers/class.products_viewed_counter.php on line 37.

[21-May-2022 06:47:13 America/Los_Angeles] Request URI: /index.php?main_page=index&cPath=21, IP address: xxx.xxx.xxx.xxx
#1 require_once(/home/zencart/includes/languages/english/index.php) called at [/home/zencart/includes/modules/require_languages.php:22]
#2 require(/home/zencart/includes/modules/require_languages.php) called at [/home/zencart/includes/modules/pages/index/header_php.php:123]
#3 require(/home/zencart/includes/modules/pages/index/header_php.php) called at [/home/zencart/index.php:35]
--> PHP Warning: Constant TABLE_HEADING_PRODUCTS already defined in /home/zencart/includes/languages/english/index.php on line 33.

21 May 2022, 4:44 PM
#2
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
507
Plugin Contributions:
1

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

Under Admin>Configuration>Logging there are two fields that need changing to IgnoreDups

They are: Report All Errors (Admin)? ; Report All Errors (Store)?

This should remove the duplicate errors.

If this does not remove all of them, there is more info in https://github.com/zencart/zencart/issues/4712 that may help.

21 May 2022, 5:52 PM
#3
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
163
Plugin Contributions:
0

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

brittainmark:

Under Admin>Configuration>Logging there are two fields that need changing to IgnoreDups

They are: Report All Errors (Admin)? ; Report All Errors (Store)?

This should remove the duplicate errors.

If this does not remove all of them, there is more info in https://github.com/zencart/zencart/issues/4712 that may help.

Im not sure if duplicate errors is the issue. At least not within each reload of the page to trigger it. I took a read of the git link, and I dont believe the is the same issue, as this shopping cart Image Hander , or even Light Box.

But I've changed the setting anyways, and the exact same lines of errors gets generated in a new myDEBUG-*-warn.log gets created each time the page reloads.
It seems to have the finger print of zc 1.57d having some compatibility issues with PHP 8.x. Rolling back to PHP 7.4, and all its normal and quiet again.

21 May 2022, 7:06 PM
#4
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
507
Plugin Contributions:
1

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

PHP 7.4 is the one to use for 1.5.7.
from 1.5.7 docs

Zen Cart v1.5.7 is designed for PHP 5.6 to 8.0, with MySQL 5.1 to 5.7 (or MariaDB 10.0-10.5) and Apache 2.2/2.4<br>
                (Some older plugins may show deprecations and warnings when using PHP 8)

I believe that 1.5.8 will be PHP 8 compatible.
From the 1.5.8 docs.

Zen Cart v1.5.8 is designed for PHP 7.3 to 8.1, with MySQL 5.7.8+ (or MariaDB 10.2.7+) and Apache 2.2/2.4

Note 1.5.8 is not yet released.

21 May 2022, 7:38 PM
#5
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
163
Plugin Contributions:
0

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

brittainmark:

PHP 7.4 is the one to use for 1.5.7.
from 1.5.7 docs

Zen Cart v1.5.7 is designed for PHP 5.6 to 8.0, with MySQL 5.1 to 5.7 (or MariaDB 10.0-10.5) and Apache 2.2/2.4<br>
(Some older plugins may show deprecations and warnings when using PHP 8)

> I believe that 1.5.8 will be PHP 8 compatible.
> From the 1.5.8 docs.
> ```
Zen Cart v1.5.8 is designed for PHP 7.3 to 8.1, with MySQL 5.7.8+ (or MariaDB 10.2.7+) and Apache 2.2/2.4

Note 1.5.8 is not yet released.

Thank you, for that bit of definitive information, now I can put this thought to ease.
The motivation for me to pursue a PHP 8.x upgrade is because one of my clients is hosted on a managed Dreamhost VPS, and they have just announced that PHP 7.x will not be supported come Aug of 2022. This might be prudent for those who do not already know this.
Hope 1.5.8 will be a forgiving upgrade.

22 May 2022, 12:48 AM
#6
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

chibipaw:

Thank you, for that bit of definitive information, now I can put this thought to ease.
The motivation for me to pursue a PHP 8.x upgrade is because one of my clients is hosted on a managed Dreamhost VPS, and they have just announced that PHP 7.x will not be supported come Aug of 2022. This might be prudent for those who do not already know this.
Hope 1.5.8 will be a forgiving upgrade.

This is the first I have heard of Dreamhost making that move. That affects me as well.

22 May 2022, 5:19 AM
#7
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
163
Plugin Contributions:
0

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

g2ktcf:

This is the first I have heard of Dreamhost making that move. That affects me as well.

This site was on ZC 1.55f, thus barfed horrible when Dreamhost tried to forcefully upgrade to PHP 8.0. ZC 1.57d works, but noisy with the warning you cant turn off isnt exactly elegant solution either.
Here's a screen shot of what I got after their failed attempt.

Attachment 20007

23 May 2022, 4:12 AM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

chibipaw:

Just spent time upgrade one of my shopping cart from ZC 1.55f php 7.3 to ZC 1.57d with PHP 8.1
I have notice the following pattern:
ZC 1.57d seems to run flawlessly on Php 7.4. Its basic cart, so it doesnt really throw log entries at all, not even warnings or deprivation notices.

However up on upgrading to PHP 8.0 (and even 8.1) , ZC 1.57d throws a whole lot of warnings. The warnings looks like they are from ZC core files.
Is this a known issue with when running ZC 1.57d with PHP 8.0? Is there a way to temporarily suppress the warnings, as I don't think php.ini affects ZC log files?

Thanks.


Index page:

#1 require_once(/home/zencart/includes/init_includes/init_sessions.php) called at [/home/zencart/includes/autoload_func.php:37]
#2 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#3 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "SSL_SESSION_ID" in /home/zencart/includes/init_includes/init_sessions.php on line 132.

[21-May-2022 06:29:50 America/Los_Angeles] Request URI: /, IP address: xxx.xxx.xxx.xxx
#1 products_viewed_counter->should_be_excluded() called at [/home/zencart/includes/classes/observers/class.products_viewed_counter.php:17]
#2 products_viewed_counter->__construct() called at [/home/zencart/includes/autoload_func.php:44]
#3 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#4 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "spider_flag" in /home/zencart/includes/classes/observers/class.products_viewed_counter.php on line 37.

Load any category:
[21-May-2022 06:47:13 America/Los_Angeles] Request URI: /index.php?main_page=index&cPath=21, IP address: xxx.xxx.xxx.xxx
#1 require_once(/home/zencart/includes/init_includes/init_sessions.php) called at [/home/zencart/includes/autoload_func.php:37]
#2 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#3 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "SSL_SESSION_ID" in /home/zencart/includes/init_includes/init_sessions.php on line 132.

[21-May-2022 06:47:13 America/Los_Angeles] Request URI: /index.php?main_page=index&cPath=21, IP address: xxx.xxx.xxx.xxx
#1 products_viewed_counter->should_be_excluded() called at [/home/zencart/includes/classes/observers/class.products_viewed_counter.php:17]
#2 products_viewed_counter->__construct() called at [/home/zencart/includes/autoload_func.php:44]
#3 require(/home/zencart/includes/autoload_func.php) called at [/home/zencart/includes/application_top.php:222]
#4 require(/home/zencart/includes/application_top.php) called at [/home/zencart/index.php:25]
--> PHP Warning: Undefined array key "spider_flag" in /home/zencart/includes/classes/observers/class.products_viewed_counter.php on line 37.

[21-May-2022 06:47:13 America/Los_Angeles] Request URI: /index.php?main_page=index&cPath=21, IP address: xxx.xxx.xxx.xxx
#1 require_once(/home/zencart/includes/languages/english/index.php) called at [/home/zencart/includes/modules/require_languages.php:22]
#2 require(/home/zencart/includes/modules/require_languages.php) called at [/home/zencart/includes/modules/pages/index/header_php.php:123]
#3 require(/home/zencart/includes/modules/pages/index/header_php.php) called at [/home/zencart/index.php:35]
--> PHP Warning: Constant TABLE_HEADING_PRODUCTS already defined in /home/zencart/includes/languages/english/index.php on line 33.

What are your settings in admin->configuration->sessions? It appears that some of them are not default settings which in part is at least revealing some of the server issues. For example the server owns $_SERVER['SSL_SESSION_ID']. It would appear that the server is not seeing that value or perhaps there is another to which to listen at that point of processing.

23 May 2022, 5:38 AM
#9
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
163
Plugin Contributions:
0

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

mc12345678:

What are your settings in admin->configuration->sessions? It appears that some of them are not default settings which in part is at least revealing some of the server issues. For example the server owns $_SERVER['SSL_SESSION_ID']. It would appear that the server is not seeing that value or perhaps there is another to which to listen at that point of processing.

Am I doing something wrong?

Cookie Domain True
Force Cookie Use True
Check SSL Session ID True
Check User Agent True
Check IP Address True
Prevent Spider Sessions True
Recreate Session True
IP to Host Conversion Status true
Add period prefix to cookie domain True
Use root path for cookie path False

23 May 2022, 7:17 AM
#10
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

What you should always be doing is having a duplicate of your shop on a local or other development server where you can use the php you want, to get ahead of this curve. All the things 157 will trigger in php8 have been fixed in ZC158 and most if not all were fixed one-by-one, meaning you can probably find your error and the fix in the zencart Github for 158.
Using a development server means you can do all the work when it suits you, not in a panic when your hosting decides.

23 May 2022, 10:49 AM
#11
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
163
Plugin Contributions:
0

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

torvista:

What you should always be doing is having a duplicate of your shop on a local or other development server where you can use the php you want, to get ahead of this curve. All the things 157 will trigger in php8 have been fixed in ZC158 and most if not all were fixed one-by-one, meaning you can probably find your error and the fix in the zencart Github for 158.
Using a development server means you can do all the work when it suits you, not in a panic when your hosting decides.

No offense, but I already separate my dev and production environments. Not sure where that assumption came from.

Anyways, ZC 1.58 isnt out, and I dont think one should expect most operator to merge from an unfinished product.
This is just poor timing of ISPs being zealous on herding people into 8.0, and the timing of ZC release time frames.

Whats more useful is actually a solution to temporarily disable debug until zc 1.58 is ready. I know this ruffles some peoples jimmy's but people will just /dev/null linking if its constantly filling up their servers.

23 May 2022, 4:39 PM
#12
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: ZC 1.57d PHP 8.0 compatibility to what extent?

chibipaw:

This is just poor timing of ISPs being zealous on herding people into 8.0, and the timing of ZC release time frames.Actually, most of them are trying to avoid all the problems with OTHER carts.

7.4 is supported thru 28 Nov 2022 so they are jumping the gun a bit.

Since we don't allow the vulnerable platforms, we can safely run older versions.

Being a certified host and only hosting ZC helps.:P