Upgrade phpMyAdmin to 5.2.0 in CentOS 7
Let's take a look at how to upgrade to phpMyAdmin to version 5.2.0 in CentOS 7
Verify PHP version
Verify PHP version is higher than 7.2 by running below in CentOS
[snippet]php -v[/snippet]
If version is below 7.2, you'll need to upgrade PHP first
Backup old phpMyAdmin
If you've upgraded before, you might have old backup laying over. Start by removing the old backup
[snippet]sudo rm -rf /usr/share/phpMyAdmin.bak[/snippet]
Then create a backup of your current directory
[snippet]sudo mv /usr/share/phpMyAdmin/ /usr/share/phpMyAdmin.bak[/snippet]
Now we create a new phpMyAdmin directory, to replace the one we moved into .bak
[snippet]sudo mkdir /usr/share/phpMyAdmin/[/snippet]
Download phpMyAdmin
Download phpMyAdmin 5.2.0 from the official site
[snippet]sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz[/snippet]
Extract the content of the file downloaded
[snippet]sudo tar xzf phpMyAdmin-5.2.0-all-languages.tar.gz[/snippet]
Now move the extracted data into phpMyAdmin folder in /usr/share/
[snippet]sudo mv phpMyAdmin-5.2.0-all-languages/* /usr/share/phpMyAdmin[/snippet]
Blowfish and TempDir error
After you logon phpMyAdmin, you'll most likely get a Blowfish and TempDir error in the bottom of the page
[snippet]The configuration file now needs a secret passphrase (blowfish_secret).
The $cfg['TempDir'] (/usr/share/phpMyAdmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.[/snippet]
Blowfish
To fix the Blowfish error, we need to first create a config file
[snippet]sudo vi /usr/share/phpMyAdmin/config.inc.php[/snippet]
Inside the config file we past below snippet, but first we need to replace 'PASTE__32__CHAR__BLOWFISH_SECRET' with 32 random characters
[snippet]<?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';[/snippet]
TempDir
If you have TempDir error, issue is that phpMyAdmin don't have a directory to write temp files to. Let's create one and give it some permissions
[snippet]sudo mkdir /usr/share/phpMyAdmin/tmp && sudo chmod 777 /usr/share/phpMyAdmin/tmp[/snippet]
Cleanup
Now that phpMyAdmin have been upgraded, let's cleanup the files we downloaded
First remove the .tar.gz file
[snippet]sudo rm phpMyAdmin-5.2.0-all-languages.tar.gz[/snippet]
Then lets remove the extracted folder
[snippet]sudo rm -rf phpMyAdmin-5.2.0-all-languages[/snippet]
Lastly, if everything worked fine. We can proceed to remove the backup
[snippet]sudo rm -rf /usr/share/phpMyAdmin.bak[/snippet]
Tags: #phpMyAdmin #CentOS7