Apamea Tech How To? How to fix your WordPress website after upgrading to Ubuntu 22.04 / 24.04

How to fix your WordPress website after upgrading to Ubuntu 22.04 / 24.04

mad formal executive man yelling at camera

If you are getting the following error after upgrading your ubuntu server to 22.04 / 24.04

wp-blog-header.php which does and tells wordpress to load the theme
or
Tells WordPress to load the WordPress theme and output it.
or
Front to the WordPress application. This file doesn’t do anything

WordPress sites, might stop working after upgrading your server to Ubuntu 22.04 / 24.04

Don’t panic, the solution is simple,

First make sure if you are able to backup your server/website, do so before attempting anything.

Now, run the following:

php -v

If there is nothing found, and you are getting command ‘php’ not found , then yes php was removed during the upgrade.

Run now :

sudo apt update

Please note “if you get a warning msg asking you to use the default php config files instead of replacing the one you have already, DEFAULT type N”

again, this is important, the default action is to keep the current version! whenever you get the warning during this fix, always type N the default, “which is to keep your currently-installed version”

Run now:

sudo apt install php

Now, you might get the following error:

dpkg was interrupted you must manually run sudo dpkg --configure -a

Run the below:

sudo dpkg --configure -a

Run: “if you get the msg if you want to continue Y/n, type Y to continue”

sudo apt --fix-broken install

Now run the following, “if you get a warning msg asking you to use the default php config files instead of replacing the one you have already, DEFAULT type N”

Run now:

sudo apt install php
sudo reboot

Now your site should be up and running.

After your site becomes online, you might notice your site is not able to resolve DNS queries, or connection refused in the admin dashboard, if you noticed this issue please read our next article.


Explore more with Apamea Tech

Sign up to receive updates, discounts and latest posts directly to your inbox! we promise you 1-2 emails/month and no spam

From our blog: