How to Manually Upgrade phpMyAdmin

Last modified: February 5, 2023
You are here:
Estimated reading time: 2 min

Whether your repository is too slow to deliver the latest version of phpMyAdmin or you are having compatibility issues with your current version, in this article we will manually download and install the latest version of phpMyAdmin.

Introduction

This guide has been tested on Ubuntu 22.04 & 20.04 running PHP 8. It may also work for older configurations. If you have any issues, please let me know in the comments.

1. Back up phpMyAdmin

Firstly, if you followed this guide before, make sure to delete the backup directory you created.

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

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/

CD to directory.

cd /usr/share/phpmyadmin/

2. Download and Extract phpMyAdmin

phpMyAdmin 5.2.0 (released May 2022) requires PHP 7.2 or newer. To find out your PHP version in command line, run php -v. If you need to upgrade PHP, see guide: How to Upgrade from PHP 7.x to PHP 8 on Ubuntu.

  • For PHP 7.2 or newer, download phpMyAdmin 5.2.0
  • For PHP 7.1, download phpMyAdmin 5.1.4
  • For PHP 5.5 to PHP 7.4, download phpMyAdmin-4.9.10

Visit the phpMyAdmin download page and look for the .tar.gz URL and download it using wget. In this guide we are using version 5.2.0, released May 2022. If a later version is now available, make sure to change the commands below to match.

Download phpMyAdmin.

sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz

Now extract.

sudo tar xzf phpMyAdmin-5.2.0-all-languages.tar.gz

Once extracted, list folder.

ls

You should see a new folder phpMyAdmin-5.2.0-all-languages

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

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

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

3. Blowfish Secret and TempDir Errors

3.1. blowfish_secret error

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

We can specify a blowfish secret using a phpMyAdmin config file.

phpMyAdmin first loads /usr/share/phpmyadmin/libraries/config.default.php and then overrides those values with anything found in /usr/share/phpmyadmin/config.inc.php.

Create config.inc.php.

sudo nano /usr/share/phpmyadmin/config.inc.php

Your file should look something like below. Generate your own 32-character blowfish secret and paste it below.

/usr/share/phpmyadmin/config.inc.php
<?php
// use here a value of your choice 32 chars long
$cfg['blowfish_secret'] = 'PASTE__32__CHAR__BLOWFISH_SECRET';

$i=0;
$i++;
$cfg['Servers'][$i]['auth_type']     = 'cookie';

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

Log back into phpMyAdmin and check that the error is gone.

 

3.2. $cfg[‘TempDir’] (./tmp/) is not accessible error

If you are seeing an error The $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

You need to create this directory and make it writable.

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

Log back into phpMyAdmin and check that the error is gone.

4. Cleanup

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

sudo rm /usr/share/phpmyadmin/phpMyAdmin-5.2.0-all-languages.tar.gz
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-5.2.0-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
Was this article helpful?
Dislike 0
Views: 4