CakePHP4を試す


環境構築 - Vagrant で LAMP 環境を構築 (8) -

phpMyAdminをアップデート

以前MySQLをセットアップでphpMyAdmin Ver. 4.6.6のセットアップを行いました。
その時にもワーニングが出ていましたが、レコード件数が0件のテーブルを抽出した際にもワーニングがでていました。その概要は、要素数が0件の配列変数をcount()関数でその件数を求めているというものでした。
PHP 7.2以降ではこのワーニングが出ることは知っていましたが、パッケージからインストールしていますので対応済みのバージョンが採用されているものと思っていました。
しかたがないのでアップデートすることを検討します。
phpMyAdminの本家サイトのダウンロードページには、最新バージョン5.0.2が公開されています。4系統の最新版も4.9.5と現在のバージョンより進んでいます。
それでは、パッケージのバージョンが上がっていないか確認してみましょう。

$ sudo apt update ↵
$ apt search phpmyadmin ↵
adminer/bionic 4.6.2-1 all
  Web-based database administration tool

phpliteadmin/bionic-updates,bionic-security 1.9.7.1-1ubuntu0.1 all
  web-based SQLite database admin tool

phpliteadmin-themes/bionic-updates,bionic-security 1.9.7.1-1ubuntu0.1 all
  web-based SQLite database admin tool - themes

phpmyadmin/bionic,now 4:4.6.6-5 all [installed]
  MySQL web administration tool

やはり変わっていません。
標準以外のどこかのリポジトリに新しいバージョンのパッケージが提供されていないか探してみましょう。
Google先生によると、どうやらPPA for phpMyAdminにあるようです。
しかし、

Do not use these packages on production! Wait until they are released through the official ubuntu-channels.

とあります。
運用環境に導入する際には十分注意したほうが良いようです。
今回は開発用ですので、作業を進めたいと思います。

$ sudo add-apt-repository ppa:phpmyadmin/ppa ↵
 Test packages for Ubuntu, maintained on salsa.debian.org/phpmyadmin-team

Do not use these packages on production! Wait until they are released through the official ubuntu-channels.
 More info: https://launchpad.net/~phpmyadmin/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it. ↵

Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                      
Hit:3 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease            
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                             
Get:5 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu bionic InRelease [15.9 kB]                            
Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                                           
Get:7 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu bionic/main amd64 Packages [2332 B]                   
Get:8 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu bionic/main Translation-en [2108 B]                                                   
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [932 kB]              
Fetched 1204 kB in 7s (167 kB/s)                                                                                                           
Reading package lists... Done
$ sudo apt update ↵
Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                   
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                                          
Hit:4 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu bionic InRelease                          
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease        
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
$ apt search phpmyadmin ↵
Sorting... Done
Full Text Search... Done
adminer/bionic 4.6.2-1 all
  Web-based database administration tool

php-phpmyadmin-motranslator/bionic 5.0.0-3 all
  translation API for PHP using Gettext MO files

php-phpmyadmin-shapefile/bionic 2.1-2 all
  translation API for PHP using Gettext MO files

php-phpmyadmin-sql-parser/bionic 4.6.1-2 all
  validating SQL lexer and parser

phpliteadmin/bionic-updates,bionic-security 1.9.7.1-1ubuntu0.1 all
  web-based SQLite database admin tool

phpliteadmin-themes/bionic-updates,bionic-security 1.9.7.1-1ubuntu0.1 all
  web-based SQLite database admin tool - themes

phpmyadmin/bionic 4:4.9.5+dfsg1-2 all [upgradable from: 4:4.6.6-5]
  MySQL web administration tool

新しいバージョンのパッケージが確認できました。
更新しましょう。

$ sudo apt upgrade phpmyadmin ↵

途中、

 ┌──────────────────────────────────────────────────────┤ Configuring phpmyadmin ├───────────────────────────────────────────────────────┐
 │ According to the maintainer for this package, database upgrade operations need to be performed on phpmyadmin. Typically, this is due  │
 │ to changes in how a new upstream version of the package needs to store its data.                                                      │
 │                                                                                                                                       │
 │ If you want to handle this process manually, you should refuse this option. Otherwise, you should choose this option. During the      │
 │ upgrade, a backup of the database will be made in /var/cache/dbconfig-common/backups, from which the database can be restored in the  │
 │ case of problems.                                                                                                                     │
 │                                                                                                                                       │
 │ Perform upgrade on database for phpmyadmin with dbconfig-common?                                                                      │
 │                                                                                                                                       │
 │                                        <Yes>                                           <No>                                           │
 │                                                                                                                                       │
 └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

と出てきたところで、Yesを選択します。
処理が終わったところで、phpMyAdminにログインしなおします。

バージョンアップが確認できました。