简体   繁体   English

PHP 8.1.6,XAMPP -> 致命错误:未捕获的错误:调用未定义的 function grapheme_strlen()

[英]PHP 8.1.6, XAMPP -> Fatal error: Uncaught Error: Call to undefined function grapheme_strlen()

PHP 8.1.6 does not find grapheme_strlen() . PHP 8.1.6 没有找到 grapheme_strlen grapheme_strlen() Any ideas why this happens?任何想法为什么会发生这种情况?

Full error:完整错误:

Fatal error: Uncaught Error: Call to undefined function grapheme_strlen() in C:\xampp\htdocs\api\v5\inc\classes\Validation.inc.php:90 Stack trace: #0 C:\xampp\htdocs\api\v5\tests\validation.php(14): Validation::fullname('ann') #1 {main} thrown in C:\xampp\htdocs\api\v5\inc\classes\Validation.inc.php on line 90

The function: function:

    /**
     * Checks if a fullname is valid
     *
     * @param string $fullname
     * @return FullnameValidation
     */
    static function fullname(string $fullname): FullnameValidation
    {
        $min_length = 3;
        $max_length = 30;

        if (grapheme_strlen($fullname) >= $min_length) {
            if (grapheme_strlen($fullname) <= $max_length) {
                return FullnameValidation::ok;
            } else {
                return FullnameValidation::too_long;
            }
        } else {
            return FullnameValidation::too_short;
        }
    }

Google gives me exactly zero results.谷歌给我的结果完全为零。 Seems like i'm the only person who ever had this issue.好像我是唯一一个遇到过这个问题的人。

you need to install the intl pecl extension.您需要安装 intl pecl 扩展。 i am not a XAMPP person.我不是 XAMPP 人。 but if you ran:但如果你跑:

php -m

you need to see the intl module to resolve your problem.您需要查看 intl 模块来解决您的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP 致命错误:未捕获的错误:在 Windows 中的 XAMPP v3.3.0 中调用未定义的函数 socket_create() - PHP Fatal error: Uncaught Error: Call to undefined function socket_create() in XAMPP v3.3.0 in windows grapheme_strlen函数的奇怪行为与一些行结尾 - Strange behavior of grapheme_strlen function with some line endings PHP致命错误:调用Xampp中未定义的函数json_decode() - PHP Fatal error: Call to undefined function json_decode() in Xampp (PHPUnit) PHP 致命错误:未捕获的错误:调用未定义的 function each() - (PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each() 致命错误:未捕获错误:调用 C:\\xampp\\htdocs\\phpmvc\\app\\models\\Mahasiswa_model.php:31 中未定义的函数 query() - Fatal error: Uncaught Error: Call to undefined function query() in C:\xampp\htdocs\phpmvc\app\models\Mahasiswa_model.php:31 PHP致命错误:未捕获错误:调用未定义函数getheaders() - PHP Fatal error: Uncaught Error: Call to undefined function getheaders() 致命错误:未捕获错误:调用未定义的函数 - Fatal error: Uncaught Error: Call to undefined function 致命错误:调用未定义的函数 mb_strlen() - Fatal error: Call to undefined function mb_strlen() 致命错误:未捕获错误:调用 C:\\xampp\\htdocs\\ 中未定义的函数 mysql_connect() - Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\ Fatal error: Uncaught Error: Call to a member function query() on null in C:\xampp\htdocs\shop\index.php - Fatal error: Uncaught Error: Call to a member function query() on null in C:\xampp\htdocs\shop\index.php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM