Forums / Upgrading to 1.5.x / PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

Views: 4,805

Results 1 to 7 of 7
15 Feb 2023, 2:35 PM
#1
chrisfourie avatar

chrisfourie

New Zenner

Join Date:
Jan 2018
Location:
Durban, South Africa
Posts:
5
Plugin Contributions:
0

PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

Good day,

I have upgraded the PHP version on my shared server from 8.0.0 to 8.0.25.

I am still able to log into the backend (http://ccfsecuritysystems.co.za/zcadmin) but the front-end is broken (https://ccfsecuritysystems.co.za/). I just get a blank page.

Zen Cart 1.5.7c
Database Patch Level: 1.5.7c

Server OS: Linux 4.18.0-372.32.1.lve.el8.x86_64
HTTP Server: LiteSpeed
PHP Version: 8.0.25 (Zend: 4.0.25)
Database Engine: MySQL 10.4.27-MariaDB-cll-lve

Is there anything I need to change on my Zencart installation or should I revert back to PHP version: 8.0.0?

15 Feb 2023, 3:08 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,111
Plugin Contributions:
56

Re: PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

ChrisFourie:

Good day,

I have upgraded the PHP version on my shared server from 8.0.0 to 8.0.25.

I am still able to log into the backend (http://ccfsecuritysystems.co.za/zcadmin) but the front-end is broken (https://ccfsecuritysystems.co.za/). I just get a blank page.

Zen Cart 1.5.7c
Database Patch Level: 1.5.7c

Server OS: Linux 4.18.0-372.32.1.lve.el8.x86_64
HTTP Server: LiteSpeed
PHP Version: 8.0.25 (Zend: 4.0.25)
Database Engine: MySQL 10.4.27-MariaDB-cll-lve

Is there anything I need to change on my Zencart installation or should I revert back to PHP version: 8.0.0?
When you get that blank screen, it's an indication of a PHP error. Check your /logs directory (or via the Display Logs plugin in the admin) to see what's been reported.

Post the contents of one of the logs here, using the "CODE" tags (the big **# **in the menu-bar when you write your response).

15 Feb 2023, 5:44 PM
#3
chrisfourie avatar

chrisfourie

New Zenner

Join Date:
Jan 2018
Location:
Durban, South Africa
Posts:
5
Plugin Contributions:
0

Re: PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

Thanks for the response. Herewith the PHP Fatal Error in the logs:

[15-Feb-2023 19:40:20 Africa/Johannesburg] Request URI: /, IP address: 102.165.201.1
--> PHP Fatal error: Uncaught TypeError: floor(): Argument #1 ($num) must be of type int|float, string given in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php:455
Stack trace:
#0 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php(455): floor()
#1 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/templates/yourstore/common/html_header.php(98): RiCjLoaderPlugin->loadCssJsFiles()
#2 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/index.php(42): require('/home/ccfsecur/...')
#3 {main}
  thrown in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php on line 455.

Line 455:
$browser_version = floor($browser->getVersion());

15 Feb 2023, 5:56 PM
#4
chrisfourie avatar

chrisfourie

New Zenner

Join Date:
Jan 2018
Location:
Durban, South Africa
Posts:
5
Plugin Contributions:
0

Re: PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

#0 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php(455): floor()```
$browser_version = floor($browser->getVersion());

#1 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/templates/yourstore/common/html_header.php(98): RiCjLoaderPlugin->loadCssJsFiles()```
$RI_CJLoader->loadCssJsFiles();

#2 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/index.php(42): require('/home/ccfsecur/...')```
require($template->get_template_dir('html_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/html_header.php');

15 Feb 2023, 6:51 PM
#5
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

ChrisFourie:

Thanks for the response. Herewith the PHP Fatal Error in the logs:

[15-Feb-2023 19:40:20 Africa/Johannesburg] Request URI: /, IP address: 102.165.201.1
--> PHP Fatal error: Uncaught TypeError: floor(): Argument #1 ($num) must be of type int|float, string given in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php:455
Stack trace:
#0 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php(455): floor()
#1 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/templates/yourstore/common/html_header.php(98): RiCjLoaderPlugin->loadCssJsFiles()
#2 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/index.php(42): require('/home/ccfsecur/...')
#3 {main}
thrown in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php on line 455.

> 
> Line 455:
> $browser_version = floor($browser->getVersion());

When I had this issue I replaced line 455 with,

$browser_version = floor((int)$browser->getVersion());


This was based on little knowledge of PHP so may not be wholly correct but it seems to work for me.

Simon

15 Feb 2023, 7:19 PM
#6
chrisfourie avatar

chrisfourie

New Zenner

Join Date:
Jan 2018
Location:
Durban, South Africa
Posts:
5
Plugin Contributions:
0

Re: PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

Thank you Simon,

It worked but I still had another small issue.

[15-Feb-2023 21:04:05 Africa/Johannesburg] Request URI: /, IP address: 102.165.201.1
--> PHP Fatal error: Uncaught Error: Undefined constant "SSL" in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/languages/english/html_includes/yourstore/define_footer_v2.php:8
Stack trace:
#0 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/templates/yourstore/common/tpl_footer.php(37): include()
#1 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/templates/yourstore/common/tpl_main_page.php(346): require('/home/ccfsecur/...')
#2 /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/index.php(94): require('/home/ccfsecur/...')
#3 {main}
thrown in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/includes/languages/english/html_includes/yourstore/define_footer_v2.php on line 8.

<div class="footer-logo hidden-xs">
                    <!--  Logo  --> 
                    <a class="logo" href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'SSL'); ?>"> <img alt="<?php if($logo_image!=NULL){ echo "logo"; } ?>" src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'images').'/uploads/'.$logo_image;?>" /> </a> 
                    <!-- /Logo --> 
                </div>

I just placed the SSL between single ' ' and then it worked.

15 Feb 2023, 10:16 PM
#7
carlwhat avatar

carlwhat

zennedOut

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

Re: PHP Version: 8.0.0 upgraded to PHP Version: 8.0.25 - Front end down work

ChrisFourie:

I have upgraded the PHP version on my shared server from 8.0.0 to 8.0.25.

ChrisFourie:

[15-Feb-2023 19:40:20 Africa/Johannesburg] Request URI: /, IP address: 102.165.201.1
--> PHP Fatal error: Uncaught TypeError: floor(): Argument #1 ($num) must be of type int|float, string given in /home/ccfsecur/domains/ccfsecuritysystems.co.za/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php:455

> 
> Line 455:
> $browser_version = floor($browser->getVersion());

the [function floor](https://www.php.net/manual/en/function.floor.php) has not changed from php 8.0.0 to 8.0.25.  so reverting it back should not resolve your problem.

the RiCjLoader has not been updated in quite some time.  or at least i have not seen an update.  nor have i ever seen any browser specific css or js files; which is what the var $bowser_version is doing.

simon1066's solution certainly will work.  i just removed the floor from my clients site who make use of it.  ie:

$browser_version = $browser->getVersion();


hope that helps.

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