How to Manually Upgrade phpMyAdmin

How to Manually Upgrade phpMyAdmin

Since the release of Ubuntu 18.04 and other Linux distros, many people have been having compatibility issues with PHP 7.2 and phpMyAdmin 4.6 and above. In this article, we will manually download and install the latest version of phpMyAdmin to resolve these issues.

1. Back up phpMyAdmin
You should back up your current phpMyAdmin folder by renaming it.

sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak

Create a new phpMyAdmin folder

sudo mkdir /usr/share/phpmyadmin/

Change to directory

cd /usr/share/phpmyadmin/

2. Download and Extract phpMyAdmin

Visit the phpMyAdmin download page and look for the .tar.gz URL and download it using wget. In this guide we are using version 4.9.4, released January 2020. If a later version is now available, make sure to change the commands below to match (and let me know in the comments so I can update the guide 😉).

sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip

Now extract, install unzip if you don’t have it.

sudo apt install unzip
unzip phpMyAdmin-5.0.1-all-languages.zip

You should see a new folder “phpMyAdmin-5.0.1-all-languages”

We want to move the contents of the above folder to /usr/share/phpmyadmin

sudo mv phpMyAdmin-5.0.1-all-languages/* /usr/share/phpmyadmin

You can now log back into phpMyAdmin and check the current version. You may also see two errors:

3. Fix common errors

If you are seeing the errors in red on the screenshot below:

error-phpmyadmin

We’ll need to run the commands below to fix the errors above in red on the screenshot.

cd /usr/share/phpmyadmin/
mkdir tmp && chmod 777 tmp

You may also see an error “The configuration file now needs a secret passphrase (blowfish_secret)”. The blowfish secret is used by phpMyAdmin for cookie authentication.

sudo nano /usr/share/phpmyadmin/libraries/vendor_config.php

Press CTRL + W and search for CONFIG_DIR

Change line to:

define('CONFIG_DIR', '/etc/phpmyadmin/');

Save file and exit. (Press CTRL + X, press Y and then press ENTER).

Now log back into phpMyAdmin and ensure the errors are gone.

4. Cleanup
You can now delete the tar.gz file and the empty folder.

sudo rm /usr/share/phpmyadmin/phpMyAdmin-5.0.1-all-languages.zip
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-5.0.1-all-languages

And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.

sudo rm -rf /usr/share/phpmyadmin.bak

 

 

Learn here “How to Install phpMyAdmin with Nginx on Ubuntu 18.04 LTS”

ABOUT AUTHOR

Nuno

I am a Freelance Web Developer and WordPress Expert based in London with a wealth of website development and support experience. I am great at problem solving and developing quick solutions.

LEAVE A COMMENT

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • LET'S TALK!

    Fill in the form below to make an enquiry or find my contact details on my contact page.

  • This form collects your name and email address so that I can respond to the enquiry(ies) that you submit via this website. Please check my privacy policy for the full story on how I use, protect and manage your submitted data.