为了账号安全,请及时绑定邮箱和手机立即绑定

当我单击导出时,phpmyadmin 中会发生此错误

当我单击导出时,phpmyadmin 中会发生此错误

PHP
慕无忌1623718 2022-10-09 19:58:33
./../../php/tcpdf/include/tcpdf_fonts.php#1671 中的警告 chr() 期望参数 1 为 int,给定字符串回溯tcpdf_fonts.php#1671: chr(string '') tcpdf_fonts.php#1803: TCPDF_FONTS::unichr( string '', boolean true, ) tcpdf_fonts.php#2095: TCPDF_FONTS::UTF8ArrSubString( array, integer 0, integer 1, boolean true, ) tcpdf.php#1960: TCPDF_FONTS::utf8Bidi(array, string '', boolean false, boolean true, NULL, ) ./libraries/classes/Pdf.php#50: TCPDF->__construct( string 'L ',字符串 'pt',字符串 'A3',布尔值 true,字符串 'UTF-8',布尔值 false,布尔值 false,) ./libraries/classes/Plugins/Export/Helpers/Pdf.php#58: PhpMyAdmin\Pdf ->__construct(字符串'L',字符串'pt',字符串'A3',布尔真,字符串'UTF-8',布尔假,布尔假,)./libraries/classes/Plugins/Export/ExportPdf.php# 70:PhpMyAdmin\Plugins\Export\Helpers\Pdf->__construct(字符串'L',字符串'pt',字符串'A3',)./libraries/classes/Plugins/Export/ExportPdf.php#55:PhpMyAdmin\Plugins\Export \ExportPdf->initSpecificVariables()在此处输入图像描述 ./libraries/classes/Plugins.php#99: PhpMyAdmin\Plugins\Export\ExportPdf->__construct() ./libraries/classes/Display/Export.php#677: PhpMyAdmin\Plugins::getPlugins( string 'export', string 'libraries/classes/Plugins/Export/', array, ) ./db_export.php#147: PhpMyAdmin\Display\Export->getDisplay( string 'database', string 'wordpress', string '', string '', integer 14, integer 0, string 'TablesStructureDataSelect all wp_commentmetawp_commentswp_linkswp_optionswp_postmetawp_postswp_termmetawp_termswp_term_relationshipswp_term_taxonomywp_usermetawp_userswp_yoast_seo_linkswp_yoast_seo_meta ', )
查看完整描述

3 回答

?
桃花长相依

TA贡献1860条经验 获得超8个赞

运行此命令:


sudo nano +1671 /usr/share/php/tcpdf/include/tcpdf_fonts.php

is_numeric($c)在公共方法主体中添加此条件,因此更改:


public static function unichr($c, $unicode=true) {

    if (!$unicode) {

        return chr($c);

    } elseif ($c <= 0x7F) {

        // one byte

        return chr($c);

    } elseif ($c <= 0x7FF) {

        // two bytes

        return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);

    } elseif ($c <= 0xFFFF) {

        // three bytes

        return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);

    } elseif ($c <= 0x10FFFF) {

        // four bytes

        return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);

    } else {

        return '';

    }

}


public static function unichr($c, $unicode=true) {

    if (is_numeric($c)){

        if (!$unicode) {

            return chr($c);

        } elseif ($c <= 0x7F) {

            // one byte

            return chr($c);

        } elseif ($c <= 0x7FF) {

            // two bytes

            return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);

        } elseif ($c <= 0xFFFF) {

            // three bytes

            return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);

        } elseif ($c <= 0x10FFFF) {

            // four bytes

            return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);

        } else {

            return '';

        }

    }

}


查看完整回答
反对 回复 2022-10-09
?
小怪兽爱吃肉

TA贡献1852条经验 获得超1个赞

我已经解决了这个问题,我只是升级了 PHPMyAdmin 和 MYSQL 最新版本。



查看完整回答
反对 回复 2022-10-09
?
宝慕林4294392

TA贡献2021条经验 获得超8个赞

一种快速的解决方案是降级您的 PHP 版本,假设您在 PHP 7.4 上运行。或者参考这个 URL https://github.com/tecnickcom/TCPPDF/pull/123/commits/34eb0dff48eb0b0d5f38f4cfd92ef6d47aefc8b4

使用 TCPDF 修复了此错误


查看完整回答
反对 回复 2022-10-09
  • 3 回答
  • 0 关注
  • 103 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信