I run an Ubuntu server at work for internal purposes and updated my PHP version to 8.1. That broke PHPMyAdmin (because it was quite outdated) so I had to update it. And the process was fairly simple. Continue reading to learn how I did it.
Firstly, let me say that I got massive help from the ByteXD website: https://bytexd.com/how-to-update-phpmyadmin-to-the-latest-version/. I was getting errors and their article helped me out a ton! Now, on to what I did.
I can’t stress this enough: backup backup backup!
I backed up the PHPMyAdmin folder by typing this command in the terminal:
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
I created a new PHPMyAdmin folder by typing this command in the terminal:
sudo mkdir /usr/share/phpmyadmin/
Then I moved to the new folder:
cd /usr/share/phpmyadmin/
I had previously downloaded the PHPMyAdmin v5.2.1 and moved it to the folder. But you can download it by using wget
in the terminal like so:
sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.tar.gz
Type the following command in the terminal to extract the files to the newly created PHPMyAdmin folder:
sudo tar xzf phpMyAdmin-5.2.1-all-languages.tar.gz
You should have a folder called “phpMyAdmin-5.2.1-all-languages”. To see it type ls
(that’s lowercase L S) in the terminal.
Lastly, we move the extraced files from within the “phpMyAdmin-5.2.1-all-languages” folder to the “PhpMyAdmin” folder. To do so, type this command into the terminal:
sudo mv phpMyAdmin-5.2.1-all-languages/* /usr/share/phpmyadmin
That should be all you need to do. Login to PHPMyAdmin and check out the version. It should be the version you downloaded.
Now if you run into any errors (like I did), check out ByteXD’s post for common errors and solutions (link at the top of this page).