1. Back up phpMyAdmin
You should back up your current phpMyAdmin folder by renaming it:
$ sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
2. Create a new phpMyAdmin folder:
$ sudo mkdir /usr/share/phpmyadmin/
Change to directory:
$ cd /usr/share/phpmyadmin/
3. Download and Extract phpMyAdmin
Go to the phpMyAdmin download page and look for the latest .tar.gz
URL and download it using wget. As of this writing, we are using version 4.8.5:
$ sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.tar.gz
Now extract:
$ sudo tar xzf phpMyAdmin-4.8.5-all-languages.tar.gz
Once extracted, list folder:
$ ls
You should see a new folder phpMyAdmin-4.8.5-all-languages
We want to move the contents of this folder to /usr/share/phpmyadmin
:
$ sudo mv phpMyAdmin-4.8.5-all-languages/* /usr/share/phpmyadmin
You can now log back into phpMyAdmin and check the current version. You may also see two errors:
ERRORS & SOLUTIONS 1
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.
Open vendor_config.php
:
$ sudo nano /usr/share/phpmyadmin/libraries/vendor_config.php
Press CTRL + W and search for TEMP_DIR
Change line to:
define('TEMP_DIR', '/var/lib/phpmyadmin/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.
Press CTRL + W and search for CONFIG_DIR
Change line to:
define('CONFIG_DIR', '/etc/phpmyadmin/');
phpMyAdmin will now generate its own blowfish secret based on the install directory.
Save file and exit. (Press CTRL + X, press Y and then press ENTER)
Now log back in to phpMyAdmin and ensure the errors are gone.
ERRORS & SOLUTIONS 2
If you still see an error message like:
The secret passphrase in configuration (blowfish_secret) is too short.
Open /var/lib/phpmyadmin/blowfish_secret.inc.php
:
$ 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'] = '~zKlE*FosK(o=WKHqrle9rK*zh+)J#(lJCgvuDeB{%l';
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.
REFERENCES
https://devanswers.co/manually-upgrade-phpmyadmin/
https://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
Thank you very much!
Great! Thanks
great solved my headcahe!
extremely well laid out – was able to upgrade phpmyadmin with 0 headaches. great job thank you
thanks it helped me alot after tons of misleading manuals, that one helped me a lot
Thank you for this information. It solved my issue.