This guide helps you to upgrade an existing and configured installation of phpmyadmin from source. This may be necessary if the provided version of your OS lags behind the available version and/or you see PHP errors when using it and you need an updated version.
|The guide has been tested but comes as it is without any warranty.|
You must already have an existing, configured and working
If you have installed
phpmyadmin with the packagemanager, check your existing version with the following command:
sudo apt-cache policy phpmyadmin
phpmyadmin, post login, look at the bottom right side to see the actual version running.
You will find the binaries of your installation in the directory:
You can upgrade
phpmyadmin most easily to a later, but also most likely not to the latest, version when adding a PPA provided by the phpmyadmin team. To do so, type the following commands:
sudo add-apt-repository ppa:phpmyadmin/ppa
sudo apt update
sudo apt install phpmyadmin
Note: if you do not want to continue with the PPA solution, just remove it by invoking the following command. This will keep your existing phpmyadmin installation, but will not update it anymore:
sudo add-apt-repository --remove ppa:phpmyadmin/ppa
phpmyadmin, see the phpmyadmin download page and select the latest stable version or a version that fits your needs. Then start downloading, extracting and putting the files to the correct location.
Download and Move
The following example uses
phpMyAdmin-5.2.0-all-languages as the example for upgrading. The old installation location will be renamed, because we need to keep some basic configuration settings.
sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz
sudo tar -xvf phpMyAdmin-5.2.0-all-languages.tar.gz
sudo mv /usr/share/phpmyadmin /usr/share/phpmyadmin.old
sudo mkdir -p /usr/share/phpmyadmin
sudo cp -r phpMyAdmin-5.2.0-all-languages/. \ /usr/share/phpmyadmin
sudo rm -r phpMyAdmin-5.2.0-all-languages*
Recreate Basic Configuration Settings
Because the upgrade has some default basic configuration settings, it is necessary to recreate them based on the former settings coming from the Ubuntu installation. The file to change can be found in
To keep a copy of the original file from the download, create a backup with:
sudo cp /usr/share/phpmyadmin/libraries/vendor_config.php \ /usr/share/phpmyadmin/libraries/vendor_config.php.orig
The transformation of values may differ depending on the phpmyadmin version compared. Especially starting with version 5.2.0, the definitions have changed from constants to array. In addition, keys have the same name but different casing and the definition of
As rule of thumb, create a copy of the line that will be changed and make it a remark by adding
# in front to keep a safe copy.
Open two editors of your choice in parallel with the following files:
and transfer the values coming from (2) to (1) as described below, check the path values and make sure they fit your environment:
- TEMP_DIR or tempDir
'tempDir' => '/var/lib/phpmyadmin/tmp/',
'configFile' => '/etc/phpmyadmin/' . 'config.inc.php',
'customHeaderFile' => '/etc/phpmyadmin/' . 'config.header.inc.php',
'customFooterFile' => '/etc/phpmyadmin/' . 'config.footer.inc.php',