奇葩知识:部分M2(含最新2.4.5)版本在结账时会出现无法提交情况,并报错Internal Error. Details are available in Magento log file

作者:admi... 点击数: 0 收藏到会员中心
最后编辑时间: 2022-08-29 21:30

部分M2(含最新2.4.5)版本在结账时会出现无法提交情况,并报错,报错信息如下

Internal Error. Details are available in Magento log file. Report ID: webapi-630cbf9ccaff1

08202229_06.jpg


查询具体的日志表现为

[2022-08-29T13:30:19.056049+00:00] main.CRITICAL: Zend_Validate_Exception: Validate class not found from basename 'Magento\Framework\Validator\EmailAddress' in /www/wwwroot/magento2-2.4.5/vendor/magento/zendframework1/library/Zend/Validate.php:244

如何解决?

打开文件

    vendor/magento/zendframework1/library/Zend/Loader.php

修改

 public static function isReadable($filename)
    {
        if (is_readable($filename)) {
            // Return early if the filename is readable without needing the
            // include_path
            return true;
        }

        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'
            && preg_match('/^[a-z]:/i', $filename)
        ) {
            // If on windows, and path provided is clearly an absolute path,
            // return false immediately
            return false;
        }

        foreach (self::explodeIncludePath() as $path) {
            if ($path == '.') {
                if (is_readable($filename)) {
                    return true;
                }
                continue;
            }
            $file = $path . '/' . $filename;
            if (is_readable($file)) {
                return true;
            }
        }
        return false;
    }

public static function isReadable($filename)
    {
        if (is_readable($filename)) {
            // Return early if the filename is readable without needing the
            // include_path
            return true;
        }

        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'
           && preg_match('/^[a-z]:/i', $filename)
        ) {
            // If on windows, and path provided is clearly an absolute path,
            // return false immediately
            return false;
        }

        foreach (self::explodeIncludePath() as $path) {
            if ($path == '.') {
                if (self::is_readable2($filename)) {
                    return true;
                }
                continue;
            }
            $file = $path . '/' . $filename;
            if (self::is_readable2($file)) {
                return true;
            }
        }
        return false;
    }

    private static function is_readable2($filename) {
        try {
            return is_readable($filename);
        } catch (Exception $ex) {
            return false;
        }
    }


请登录已经激活账号继续浏此文章所有内容!
会员中心

已经有帐号啦 !赶紧同小伙伴们愉快地玩耍吧

立即登录

还没有账号? 马上注册一个新帐户

注册账号
内容说明:
如您需要转载本文请保留以下信息是对作者发文的支持与尊重:

奇葩知识:部分M2(含最新2.4.5)版本在结账时会出现无法提交情况,并报错Internal Error. Details are available in Magento log file 来源于 https://www.magentola.com/news-read-323.html
上一篇:Nginx 服务器上 Magento 2 站点启用 CORS跨域名
下一篇:M2依据产品ID快速删除产品程序源码
相关内容
产品推荐