1. 程式人生 > >phpmyadmin 遇到 Warning: A non-numeric value encountered

phpmyadmin 遇到 Warning: A non-numeric value encountered

在 PHP7 下出現這個警告,修復方法是,找到 phpmyadmin 的安裝目錄(Ubuntu 下在 /usr/share/phpmyadmin/),修改檔案:libraries/DisplayResults.class.php

在 854 行:

// Move to the next page or to the last one
$endpos = $_SESSION['tmpval']['pos']
    + $_SESSION['tmpval']['max_rows'];

修改為:

// Move to the next page or to the last one
$endpos = (int)$_SESSION['tmpval']['pos']
    + (int)$_SESSION['tmpval']['max_rows'];