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.
This guide has been tested on Ubuntu 20.04, 18.04 and 16.04. It should also work for other Debian-based distributions without issue. For CentOS users, please refer to the comments section at the end of this page as commands will be different. I will try to update this guide for CentOS as soon as I get the chance to test it. In the meantime, if you have any suggestions on how to improve this guide, please let me know in the comments.
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
2. Download and Extract phpMyAdmin
Update Feb 2020: phpMyAdmin 5 has been released but it is only compatible with PHP 7.1 and above. To find out your PHP version in command line, run
phpMyAdmin version 4.x is now in the LTS phase, where only security fixes and critical bug fixes are made. Users are advised to migrate to version 5 (read more).
- For PHP 7.1 and above, download phpMyAdmin 5.x
- For PHP 5.5 to PHP 7.4, download phpMyAdmin-4.9.5
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.0.2, released March 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). If you are having issues with phpMyAdmin 5.x, try phpMyAdmin-4.9.5 instead.
sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-all-languages.tar.gz
sudo tar xzf phpMyAdmin-5.0.4-all-languages.tar.gz
Once extracted, list folder
You should see a new folder
We want to move the contents of this folder to
sudo mv phpMyAdmin-5.0.4-all-languages/* /usr/share/phpmyadmin
You can now log back into phpMyAdmin and check the current version. You may also see two errors:
3. Edit vendor_config.php
If you are seeing an error The $cfg[‘TempDir’] (./tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.
sudo nano /usr/share/phpmyadmin/libraries/vendor_config.php
W and search for
Change line to
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.
W and search for
Change line to
phpMyAdmin will now generate its own blowfish secret based on the install directory.
Save file and exit. (Press
Y and then press
Now log back in to phpMyAdmin and ensure the errors are gone.
If you are seeing an error “The secret passphrase in configuration (blowfish_secret) is too short.”, see below.
If you are having issues with phpMyAdmin 5, try phpMyAdmin-4.9.5 instead as this is the latest stable release for PHP 7.0 and lower and MySQL 5.4 and lower.
You can now delete the tar.gz file and the empty folder.
sudo rm /usr/share/phpmyadmin/phpMyAdmin-5.0.4-all-languages.tar.gz
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-5.0.4-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
Blowfish Secret Error “Too Short”
If you are seeing an error “The secret passphrase in configuration (blowfish_secret) is too short.”
sudo nano /var/lib/phpmyadmin/blowfish_secret.inc.php
You will need to enter new characters after
$cfg['blowfish_secret'] = (up to 46 characters). You can use this phpMyAdmin Blowfish Secret Generator to generate a random string. Example:
$cfg['blowfish_secret'] = '32_char_random_phrase_here';
Save file and exit. (Press CTRL + X, press Y and then press ENTER)
Log off and log back on again to phpMyAdmin and the warning should be gone.