Jump to content

Switching to PHP 8.0/8.1 breaks site after clearing system cache


Recommended Posts

Been wanting to update my site for a while to the current version of IPB, however, whenever I switch to the required PHP 8.0 or above (I tried both 8.0 and 8.1) the site will work as typical for a bit but eventually will start giving error 500 on both the site and admin panel, this break happens immediately if I goto admin panel's support page and click clear the system cache. Switching back to PHP 7.4 fixes it right away.

I've tried disabling all 3rd party apps and plugins and switching the default theme. The same result happens soon as I switch to PHP 8.0+

I'm using nginx webserver and Redis for system caching.

The only output I got in the nginx error log after switching to php-fpm 8.0 for a few minutes just now is the 3 errors below. I'm unsure if they are related though, as I'd expect there to be a lot more errors as the site gets heavy traffic and should've logged a lot more errors in the few minutes it was down using php8.0.

Quote

 

2023/03/22 20:47:47 [error] 722588#722588: *82123275 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot use "parent" when current class scope has no parent in /home/<snipped>/www/public/system/Theme/Theme.php(2703) : eval()'d code on line 37" while reading response header from upstream, client: <snipped>, server: www.<snipped>.com, request: "GET /files/category/203-<snipped>/page/46/?listResort=1&csrfKey=9425f6ca872103efc3e2c20e775fbe0e HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "www.<snipped>.com", referrer: "https://www.<snipped>.com/files/category/203-<snipped>/page/46/"

2023/03/22 20:47:49 [error] 722583#722583: *82129716 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot use "parent" when current class scope has no parent in /home/<snipped>/www/public/system/Theme/Theme.php(2703) : eval()'d code on line 37" while reading response header from upstream, client: <snipped>, server: www.<snipped>.com, request: "GET /admincp/?app=core&module=support&controller=support HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "www.<snipped>.com", referrer: "https://www.<snipped>.com/admincp/?app=core&module=overview&controller=dashboard"

2023/03/22 20:48:47 [error] 722580#722580: *82131013 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot use "parent" when current class scope has no parent in /home/<snipped>/www/public/system/Theme/Theme.php(2703) : eval()'d code on line 37" while reading response header from upstream, client: <snipped>, server: www.<snipped>.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "www.<snipped>.com", referrer: "https://www.google.com/"

 

Any help would be much appreciated, I've tried pretty much everything I can think of but haven't been able to make much progress on figuring it out.

Edited by ExiledVip3r
Link to comment
Share on other sites

30 minutes ago, balazsp said:

What's your current version? 

v4.7.3, which is as far as I know the last version to support PHP 7.4. Haven't been able to upgrade past it since I can't get PHP 8.0+ working smoothly.

Edited by ExiledVip3r
Link to comment
Share on other sites

One or more of your plugins is not updated to work with PHP 8.

 

Do the following:

  1. Disable all your plugins/applications.
  2. Switch to PHP 8 and confirm the site works.
  3. Re-enable your modifications 1 by 1 and find out which one is making the site crash.
  4. Switch back to PHP 7.4 to get your site working and check if a new version of the modification is available for 4.7. If not, contact the author of the plugin causing the issue to see what they say.
Link to comment
Share on other sites

I figured it out, it was an incompatible "back to top" plugin. Disabling it and making sure the cache was cleared of any hooks and such from it were gone cleared up the site to work on PHP8.0. Previous attempts at disabling/enabling it must've left some data over somewhere leading me to incorrectly assume it wasn't the cause.

Thanks.

Link to comment
Share on other sites

While I'm here, another issue I've been having trouble tracking down lately is this error message popping up frequently in the system logs:

Could contain: File, Webpage, Page, Text

 

I've been at a loss as to what could be causing it, but I've tried disabling the app the hook it's loading comes from, but the error still comes up frequently in the log, just without mentioning the loaded hook.

Link to comment
Share on other sites

On 3/24/2023 at 9:11 AM, Marc Stridgen said:

Its very likely the hook that is showing loaded these at the bottom. Try disabling that first of all. 

Did you read his post? Specifically where he wrote that he tried disabling the mentioned application?

On 3/24/2023 at 1:40 AM, ExiledVip3r said:

While I'm here, another issue I've been having trouble tracking down lately is this error message popping up frequently in the system logs:

Could contain: File, Webpage, Page, Text

 

I've been at a loss as to what could be causing it, but I've tried disabling the app the hook it's loading comes from, but the error still comes up frequently in the log, just without mentioning the loaded hook.

Upgrading to 4.7.8 or newer will most likely fix this for you, as one of the calls in the stack trace have been remove. It's related to storing the members current timezone in the database.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...