Zen Cart Logo
Forums / General Questions / PHP Warnings and Fatal errors after upgrading to PHP 8

PHP Warnings and Fatal errors after upgrading to PHP 8

Views: 1,415

Results 1 to 10 of 10
28 Jul 2021, 7:58 PM
#1
bigandrew avatar

bigandrew

New Zenner

Join Date:
Oct 2014
Location:
Georgia
Posts:
74
Plugin Contributions:
0

PHP Warnings and Fatal errors after upgrading to PHP 8

I recently upgraded from 1.5.4 using PHP 5.6 to 1.5.7c, still using 5.6 for about a week. Everything was working fine until I upgraded to PHP 8.0.

Payment modules stopped working, and customers can no longer place orders.

I've read the "PHP Warnings and Deprecated messages after upgrading" article, but I'm still not sure how to correct the issue. Here are a few errors:

[28-Jul-2021 14:19:25 America/New_York] Request URI: /store/adminohb/index.php?cmd=modules&set=payment, IP address: 99.1.220.145
#1 require(/home/andrewangelina/public_html/store/adminohb/modules.php) called at [/home/andrewangelina/public_html/store/adminohb/index.php:11]
--> PHP Warning: Undefined property: cod::$sort_order in /home/andrewangelina/public_html/store/adminohb/modules.php on line 208.

[28-Jul-2021 14:19:25 America/New_York] Request URI: /store/adminohb/index.php?cmd=modules&set=payment, IP address: 99.1.220.145
#1 require(/home/andrewangelina/public_html/store/adminohb/modules.php) called at [/home/andrewangelina/public_html/store/adminohb/index.php:11]
--> PHP Warning: Undefined property: cod::$sort_order in /home/andrewangelina/public_html/store/adminohb/modules.php on line 251.

[28-Jul-2021 14:19:25 America/New_York] Request URI: /store/adminohb/index.php?cmd=modules&set=payment, IP address: 99.1.220.145
#1 require(/home/andrewangelina/public_html/store/adminohb/modules.php) called at [/home/andrewangelina/public_html/store/adminohb/index.php:11]
--> PHP Warning: Undefined property: cod::$sort_order in /home/andrewangelina/public_html/store/adminohb/modules.php on line 257.

[28-Jul-2021 14:19:25 America/New_York] Request URI: /store/adminohb/index.php?cmd=modules&set=payment, IP address: 99.1.220.145
#1 require(/home/andrewangelina/public_html/store/adminohb/modules.php) called at [/home/andrewangelina/public_html/store/adminohb/index.php:11]
--> PHP Warning: Undefined property: cod::$sort_order in /home/andrewangelina/public_html/store/adminohb/modules.php on line 274.

I'm sure it's a simple fix, please point me in the right direction. Thanks!!

andrew

28 Jul 2021, 9:56 PM
#2
bigandrew avatar

bigandrew

New Zenner

Join Date:
Oct 2014
Location:
Georgia
Posts:
74
Plugin Contributions:
0

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

Update: I'm using Ceon Manual Card 4.0.1 as well.

When I downgrade to PHP 7.4, the checkout process works again. These are the only 2 errors that hit in the logs:

[28-Jul-2021 17:50:25 America/New_York] Request URI: /store/index.php?main_page=product_reviews_write&products_id=3057, IP address: 185.191.171.37
#1 include_once() called at [/home/andrewangelina/public_html/store/includes/autoload_func.php:28]
#2 require(/home/andrewangelina/public_html/store/includes/autoload_func.php) called at [/home/andrewangelina/public_html/store/includes/application_top.php:222]
#3 require(/home/andrewangelina/public_html/store/includes/application_top.php) called at [/home/andrewangelina/public_html/store/index.php:25]
--> PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ceon_manual_cardConfigCheck has a deprecated constructor in /home/andrewangelina/public_html/store/includes/classes/class.ceon_manual_cardConfigCheck.php on line 28.

[28-Jul-2021 17:50:25 America/New_York] Request URI: /store/index.php?main_page=product_reviews_write&products_id=3057, IP address: 185.191.171.37
#1 include_once() called at [/home/andrewangelina/public_html/store/includes/autoload_func.php:28]
#2 require(/home/andrewangelina/public_html/store/includes/autoload_func.php) called at [/home/andrewangelina/public_html/store/includes/application_top.php:222]
#3 require(/home/andrewangelina/public_html/store/includes/application_top.php) called at [/home/andrewangelina/public_html/store/index.php:25]
--> PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ceon_manual_cardSessionCleaner has a deprecated constructor in /home/andrewangelina/public_html/store/includes/classes/observers/class.ceon_manual_cardSessionCleaner.php on line 32.

28 Jul 2021, 10:08 PM
#3
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,844
Plugin Contributions:
0

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

Just because you can use PHP8 with 1.5.7c doesn't mean you should. On a stock, no addons install sure, but as soon as you add plugins to it, you are most likely in for some mydebug logs. The last time the CEON Manual card plugin was updated was in 2012 long before php8 existed closer to when php5.2 was fresh...

29 Jul 2021, 7:05 AM
#4
torvista avatar

torvista

Totally Zenned

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

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

This is why you should do all your fiddling on a development server using the latest php, in advance of your production site, to get a long, leisurely heads-up to fix these things, which always will occur with every php change.

29 Jul 2021, 7:43 AM
#5
swguy avatar

swguy

Administrator

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

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

barco57:

Just because you can use PHP8 with 1.5.7c doesn't mean you should.

Agreed. Use PHP 7.4 for now and give the devs some time to shake out the PHP8 issues.

29 Jul 2021, 1:42 PM
#6
carlwhat avatar

carlwhat

zennedOut

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

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

bigandrew:

Update: I'm using Ceon Manual Card 4.0.1 as well.

When I downgrade to PHP 7.4, the checkout process works again. These are the only 2 errors that hit in the logs:

[28-Jul-2021 17:50:25 America/New_York] Request URI: /store/index.php?main_page=product_reviews_write&products_id=3057, IP address: 185.191.171.37
#1 include_once() called at [/home/andrewangelina/public_html/store/includes/autoload_func.php:28]
#2 require(/home/andrewangelina/public_html/store/includes/autoload_func.php) called at [/home/andrewangelina/public_html/store/includes/application_top.php:222]
#3 require(/home/andrewangelina/public_html/store/includes/application_top.php) called at [/home/andrewangelina/public_html/store/index.php:25]
--> PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ceon_manual_cardConfigCheck has a deprecated constructor in /home/andrewangelina/public_html/store/includes/classes/class.ceon_manual_cardConfigCheck.php on line 28.

[28-Jul-2021 17:50:25 America/New_York] Request URI: /store/index.php?main_page=product_reviews_write&products_id=3057, IP address: 185.191.171.37
#1 include_once() called at [/home/andrewangelina/public_html/store/includes/autoload_func.php:28]
#2 require(/home/andrewangelina/public_html/store/includes/autoload_func.php) called at [/home/andrewangelina/public_html/store/includes/application_top.php:222]
#3 require(/home/andrewangelina/public_html/store/includes/application_top.php) called at [/home/andrewangelina/public_html/store/index.php:25]
--> PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ceon_manual_cardSessionCleaner has a deprecated constructor in /home/andrewangelina/public_html/store/includes/classes/observers/class.ceon_manual_cardSessionCleaner.php on line 32.

for any number of reasons, i would strongly recommend against using a manual credit card module. you can try my module, you will not be disappointed:

https://www.zen-cart.com/downloads.php?do=file&id=2272

if you want to continue using this manual credit card module, you need to change lines 28 in:

includes/classes/class.ceon_manual_cardConfigCheck.php

and line 32 in:

includes/classes/observers/class.ceon_manual_cardSessionCleaner.php

i do not use the module but you need to rename the function to __construct. and continue passing any vars that are currently in there. ie:

//change to:

function __construct($var1, $var2) {

there may not be anything where i have $var1 and $var2. but you need to change the name to __construct, which should resolve your error.

but again, i strongly recommend against using a manual credit card module.

best.

29 Jul 2021, 4:29 PM
#7
bigandrew avatar

bigandrew

New Zenner

Join Date:
Oct 2014
Location:
Georgia
Posts:
74
Plugin Contributions:
0

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

Roger that, thank you!

29 Jul 2021, 4:30 PM
#8
bigandrew avatar

bigandrew

New Zenner

Join Date:
Oct 2014
Location:
Georgia
Posts:
74
Plugin Contributions:
0

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

torvista:

This is why you should do all your fiddling on a development server using the latest php, in advance of your production site, to get a long, leisurely heads-up to fix these things, which always will occur with every php change.

Got it, thanks!!

29 Jul 2021, 4:30 PM
#9
bigandrew avatar

bigandrew

New Zenner

Join Date:
Oct 2014
Location:
Georgia
Posts:
74
Plugin Contributions:
0

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

swguy:

Agreed. Use PHP 7.4 for now and give the devs some time to shake out the PHP8 issues.

Will do. As soon as I dropped down to 7.4, a customer submitted an order. Thanks!

29 Jul 2021, 4:31 PM
#10
bigandrew avatar

bigandrew

New Zenner

Join Date:
Oct 2014
Location:
Georgia
Posts:
74
Plugin Contributions:
0

Re: PHP Warnings and Fatal errors after upgrading to PHP 8

carlwhat:

for any number of reasons, i would strongly recommend against using a manual credit card module. you can try my module, you will not be disappointed:

https://www.zen-cart.com/downloads.php?do=file&id=2272

if you want to continue using this manual credit card module, you need to change lines 28 in:

includes/classes/class.ceon_manual_cardConfigCheck.php

and line 32 in:

includes/classes/observers/class.ceon_manual_cardSessionCleaner.php

i do not use the module but you need to rename the function to __construct. and continue passing any vars that are currently in there. ie:

//change to:

function __construct($var1, $var2) {

> 
> there may not be anything where i have $var1 and $var2.  but you need to change the name to __construct, which should resolve your error.
> 
> but again, i strongly recommend against using a manual credit card module.
> 
> best.

Thank you for this, I will take a look!!