In Progress [PHP][Wordpress] "There has been a critical error on this website." After switching to PHP 8.0

Discussion in 'Free Hosting' started by rhaven, Feb 3, 2021.

  1. rhaven

    rhaven New Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Website: https://reviewhavengaming.com
    x10 Domain: http://reviewhaven.x10.mx
    x10 Server: x12

    Like the title says - I've been getting a notice on my Wordpress admin dashboard that I should update my PHP version, 7.3's been out of date for a little while now, but 7.4 wasn't available here (At least on free hosting).

    Anyway, while I was doing some cleanup in my file manager on the cPanel (Cleaning out the old domain folder, etc.) I noticed that 8.0 was available to select.

    I changed my PHP version to 8.0, hit "Set As Current" then refreshed my website aaaand...

    White Screen of Death. "There has been a critical error on this website."

    Disabling themes/plugins (By renaming folders as I can't get into the Admin while that page is up) didn't fix it, and the Debug mode shows an error on line 1685 of wp-db.

    Checking that line, it seems to be connected to MySQL and the login information for the database, but I'm drawing a blank on what the problem might be.

    Switching back to 7.3 has everything working fine again. That's what it's currently on as I don't want my site to be down entirely while trying to figure this out.

    Is it possible I deleted something I shouldn't have from the old domain folder? I kind of emptied it entirely, other than the .htaccess file so that the old domain redirects to the purchased one.

    I have the files backed up on my computer so they aren't all gone entirely - plus everything is in the new domain folder (I deleted the stuff in the old one as the site was basically duplicated and taking up twice the space it should be.)
     
  2. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,601
    Likes Received:
    239
    Trophy Points:
    63
    When you change to 8, did you make sure to enable the mysqli or pdo modules?
     
    • Useful Useful x 1
  3. rhaven

    rhaven New Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Iiiii did not. I'll try that and see if it works.

    -----
    That seems to have fixed it. Thanks!

    Just to be sure though, I notice now, on the admin dashboard, it says certain modules are disabled/not installed (imagick & zip).

    I don't see them listed under 8.0.

    Doesn't seem to be affecting anything, really, (Other than plugin installs from the admin) - just want to be sure I'm not missing something.

    Also want to make sure I have everything I need enabled. Here's what I see:

    Screenshot 2021-02-03 215925.png
     
    Last edited: Feb 3, 2021
  4. spacresx

    spacresx Community Advocate Community Support

    Messages:
    1,040
    Likes Received:
    72
    Trophy Points:
    48
    imagick is an "option" since the server default is GD.
    i dont know about the zip alternative, its not in your screenshot.
    but i noticed you have bz2 as an option.

    normally you would not need to change the by default settings,
    unless a script says it needs something that is not enabled.
     
  5. rhaven

    rhaven New Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Enabling bz2 seems to have fixed the issue with installing plugins/themes. And since GD works in place of imagick, that's not an actual issue.

    Still getting WordPress saying that the modules aren't installed, but I think it's just because it wants to be really particular.

    Screenshot 2021-02-04 125217.png

    I know, for instance, imagick is for specific stuff in the WP image editor, which I don't really use anyway. However, bz2 seems to not work for installing themes, which is a bit weird.

    Screenshot 2021-02-04 130123.png
     
    Last edited: Feb 4, 2021
  6. spacresx

    spacresx Community Advocate Community Support

    Messages:
    1,040
    Likes Received:
    72
    Trophy Points:
    48
    Honestly myself i dont trust wordpress, to many issues.
    But also i dont have php 8 on x15, im stuck at 7.2 there for now.

    generally, imagick is just an alternative to Gd2
    most scripts are usually always GD2 friendly.
    and most php installs use GD2 by default.
    and its rare that certain themes require imagick over GD2.
    that's easily fixed though by unchecking GD2 and check imagick.

    i dont know the status of your zip option though (or if you even have it)
    it may be enabled but just hidden, you could try to check bz2
    and just try to go with it.

    I dont have wordpress either.
    but its possible yours has issues with it to if it uses php 8 already.

    maybe another wordpress user can help you with that.
     
  7. rhaven

    rhaven New Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1

    Ugh. Now I'm having an even bigger problem. Switched back to 7.3 as 8.0 is lacking in features needed for WP at the moment (bz2 wasn't working and I couldn't install any themes or plugins outside of doing it manually through FTP or the file manager).

    However, now I'm having a problem where my Media Library seems to be broken. No images at all are loading. The header, featured images, screenshots, favicon - nothing. I also can't seem to upload anything either - they just blank out like the rest, no matter what.

    Screenshot 2021-02-04 232658.png
    Screenshot 2021-02-04 233101.png

    I've tried everything I can think of and nothing has worked. Clearing cookies, clearing caches, checking other devices, etc.

    Every post I've found through Bing/Google hasn't helped.

    When I try to view any image, I get the following error -
    Screenshot 2021-02-04 232730.png
    Which is really strange, as the files are 100% there on the server. And while I spent some time cleaning out old thumbnails, I was extra vigilant not to delete anything that was still in use.

    Screenshot 2021-02-04 232837.png
    The full link to an image: https://reviewhavengaming.com/wp-content/uploads/2019/12/top5-gamesofdecade.jpg

    Screenshot 2021-02-04 232927.png
    ^The image clearly sitting on the server, unmoved.

    The only thing I can figure is that one of the plugins I used recently to try and clean up my SQL database changed something, somehow, that broke everything (Although to my untrained eyes, I can't see any inconsistencies between the media gallery and the database entries - and everything was working just fine after the clean up until roughly a few hours ago.)

    I'm at a complete loss here.
     
  8. spacresx

    spacresx Community Advocate Community Support

    Messages:
    1,040
    Likes Received:
    72
    Trophy Points:
    48
    I can see your website just fine in firefox, including your images.

    did you try to update wordpress with the php 8 when you had it ??
    im thinking something might of broke switching from 8 to 7.3

    do you meet all the requirements for the wordpress + theme installed ??
    like the imagick and zip options in php settings.
    maybe something for the version of wordpress you have is still missing.
    might be why images dont show in your Media Library.
    or you would need to regenerate the thumbnails to get them to show up.
     
  9. rhaven

    rhaven New Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Meant to post earlier, but fell asleep.

    An admin from the x10 Facebook page actually helped me get this squared away this morning.

    Apparently, something was up with my htaccess file that was causing a redirect and it was making things loop eternally (Also something with it pointing to HTTP while the site was https, and I think the database had some errors there as well - it was an htaccess file that somehow got into the uploads folder). That admin removed the offending line and cleared it up. Once I cleared my cache/cookies, everything was right as rain again.

    My guess is one of the plugins I was using to help with cleanup added the htaccess file that just broke things.

    It wasn't the switch from PHP 7 to 8 or anything, just an errant line of code.

    As for the actual switch: It works for the most part, but I'm going to stick with 7.3 for the time being since 8 (At least on this server) currently doesn't have the zip module WordPress needs for installing plugins/themes on the backend automatically. imagick is less crucial, as GD works decently in its place - but might be needed for someone who deals with a lot of images and color profiles on those images.

    All in all, I'd say we can call this one resolved. After the update/fix on the htaccess file, everything's fine now. Still a few broken images here and there - but those are just old thumbnails that don't exist anymore.

    Thanks, folks!
     
    Last edited: Feb 5, 2021
  10. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,601
    Likes Received:
    239
    Trophy Points:
    63
    I'm trying to get PHP 7.3, PHP 7.4, and PHP 8.0 corrected with the deficiencies you have pointed out. I'm waiting on admin approval since I'm just a n00b with a terminal :p
     
    • Funny Funny x 1
  11. garrettroyce

    garrettroyce Community Support Community Support

    Messages:
    5,601
    Likes Received:
    239
    Trophy Points:
    63

Share This Page