Search code examples
phpoopyiiyii2yii-extensions

PHP Notice – yii\base\ErrorException


Use of undefined constant INTL_ICU_VERSION - assumed 'INTL_ICU_VERSION

Yii Framework/2.0.7

$checks[] = array( 'title' => Yii::t('base', $title), 'state' => 'ERROR', 'hint' => 'Install INTL Extension' ); }

    $icuVersion = (defined('INTL_ICU_VERSION')) ? INTL_ICU_VERSION : 0;
    $icuMinVersion = '4.8.1';
    $title = 'PHP - INTL Extension - ICU Version (' . INTL_ICU_VERSION . ')';
    if (version_compare($icuVersion, $icuMinVersion, '>=')) {
        $checks[] = array(
            'title' => Yii::t('base', $title),
            'state' => 'OK'
        );
    } else {
        $checks[] = array(
            'title' => Yii::t('base', $title),
            'state' => 'WARNING'


          'hint' => 'Install INTL Extension'
        );
    }

    $icuVersion = (defined('INTL_ICU_VERSION')) ? INTL_ICU_VERSION : 0;
    $icuMinVersion = '4.8.1';
    $title = 'PHP - INTL Extension - ICU Version (' . INTL_ICU_VERSION . ')';
    if (version_compare($icuVersion, $icuMinVersion, '>=')) {
        $checks[] = array(
            'title' => Yii::t('base', $title),
            'state' => 'OK'
        );
    } else {

Solution

  • Here's solution of your problem I guess:

    Or maybe try to update Php version