How to Manually Upgrade phpMyAdmin
On Ubuntu 18.04 and other Linux distros there is a compatibility issues with PHP 7.2 and phpMyAdmin 4.6 and above. The solution is to manually upgrade phpMyAdmin downloading and installing the latest version.
Preserve 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/
Move to new directory
cd /usr/share/phpmyadmin/
Download and Extract phpMyAdmin from phpMyAdmin download page and look for the .tar.gz URL and download it using wget
. In this guide we are using version 4.9.2, released December 2019. If a later version is now available, make sure to change the commands below to match
sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.9.2/phpMyAdmin-4.9.2-all-languages.tar.gz
Extract files from download
sudo tar xzf phpMyAdmin-4.9.2-all-languages.tar.gz
Once extracted, list folder
ls
You should see a new folder phpMyAdmin-4.9.2-all-languages
Move the contents of this folder to /usr/share/phpmyadmin
sudo mv phpMyAdmin-4.9.2-all-languages/* /usr/share/phpmyadmin
Now you can log back into phpMyAdmin and check the current version.
You may see two errors:
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.
You can now delete the tar.gz file and the empty folder.
sudo rm /usr/share/phpmyadmin/phpMyAdmin-4.9.2-all-languages.tar.gz
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-4.9.2-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
That’s all about manually upgrade phpMyAdmin