yii2应用程序以错误开始

时间:2015-04-13 03:36:06

标签: yii2

当我启动Yii2应用程序时,我遇到了一个奇怪的错误!请大家帮忙。这是我得到的:

     PHP Warning – yii\base\ErrorException

mb_strlen()期望参数1为字符串,给定数组

1. in /var/www/yii2/basic/vendor/yiisoft/yii2/helpers/BaseStringHelper.php at line 31
22232425262728293031323334353637383940

{
    /**
     * Returns the number of bytes in the given string.
     * This method ensures the string is treated as a byte array by using `mb_strlen()`.
     * @param string $string the string being measured for length
     * @return integer the number of bytes in the given string.
     */
    public static function byteLength($string)
    {
        return mb_strlen($string, '8bit');
    }

    /**
     * Returns the portion of string specified by the start and length parameters.
     * This method ensures the string is treated as a byte array by using `mb_substr()`.
     * @param string $string the input string. Must be one character or longer.
     * @param integer $start the starting position
     * @param integer $length the desired portion length. If not specified or `null`, there will be
     * no limit on length i.e. the output will be until the end of the strin

1 个答案:

答案 0 :(得分:3)

我发生了一个同样的错误信息,在我的项目中复制外部组件,我通过运行解决了问题

   composer update