5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

phpMyAdminで急にエラーが出るようになった話

Last updated at Posted at 2018-03-15

はじめに

使ってるVM(homestead)上で、急にphpMyAdminから count(): Parameter must be an array or an object that implements Countable 的なエラーが出るようになりました。

2018-03-15_16h24_59.png

調べてみたら次のような記事が。

phpmyadmin 4.7.4 is supposed to have "Fixed several compatibility issues with PHP 7.2"
Chances are you have an older version of phpmyadmin.
https://www.phpmyadmin.net/news/2017/8/24/phpmyadmin-474-released/


ガバガバ翻訳:
phpmyadminはPHP7.2との互換性の問題を修正しました
古いバージョンのphpmyadminを使用している可能性があります。

どうやら phpMyAdmin のバージョンが古くなっているのが原因のようです。

アップデート手順

/usr/share/phpmyadmin に元のソースファイルがある前提です。

console
# superuserで入ってアプリケーションの削除
sudo su
apt remove phpymadmin
rm -rf /var/share/phpmyadmin

# 適当にワークディレクトリを作る
cd /var/www/
mkdir tmp
cd tmp

# ソースファイルのダウンロード・解凍
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.9/phpMyAdmin-4.7.9-all-languages.tar.gz
# https://www.phpmyadmin.net/downloads/
tar zxvf phpMyAdmin-4.7.9-all-languages.tar.gz

# 圧縮ファイルの削除・ソースのリネーム
rm phpMyAdmin-4.7.9-all-languages.tar.gz
mv phpMyAdmin-4.7.9-all-languages phpmyadmin

# 元の場所にリプレイス
cp -R phpmyadmin /usr/share/phpmyadmin

# お好みでワークフォルダーを削除する
# cd /
# rm -R /var/www/tmp

# phpMyAdminが使用するテーブルを作成する
# まずはインポート用のsqlファイルがどこにあるか探す
find -name create_tables*
# ./phpmyadmin/sql/create_tables.sql
pwd
# /var/www/tmp

# 実際のインポート作業はMySQL側で行う
mysql

# mySQL側でインポート
source /var/www/tmp/phpmyadmin/sql/create_tables.sql

所感

もう少し分かりやすいエラーを吐いてもバチは当たらないと思う。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?