HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Class 'Locale' not found

Just installed vanilla for a try. Followed instructions found at https://websiteforstudents.com.

But instead of up and running I get the following message from the initiation phase:

Fatal Error in LocalesApiController.{closure}();

Class 'Locale' not found

Any ideas?



Additional information for support personnel:

Application: Vanilla

Application Version: 3.2-2019.012-SNAPSHOT

PHP Version: 7.2.3-1ubuntu1

Operating System: Linux

Server Software: Apache/2.4.29 (Ubuntu)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36

Request Uri: /index.php?p=/dashboard/setup

Controller: LocalesApiController

Method: {closure}


he error occurred on or near: /var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php

 99: 
100:         $populate = function (array &$row, array $locales) {
101:             $displayNames = [];
102:             foreach ($locales as $locale) {
103:                 $displayName = \Locale::getDisplayLanguage($row["localeKey"], $locale);
104: 
105:                 // Standardize capitalization
106:                 $displayName = mb_convert_case($displayName, MB_CASE_TITLE);
107: 




Comments

  • Resolved, after inst af php intl and gd

    //AR

  • Hi, I have received the same problem. Sorry but what did you say about php extensions intl and gd? The comment was pretty illegible to me.

  • never mind, I have sorted it by editing the php.ini file from ;extension=php_intl.dll and deleted the semi colon. Then duplicated the

    icu**.dll from php to apache/bin

  • gilesajgilesaj New
    edited December 2019

    I have this problem when trying to create a forum today. I installed php-intl and restarted apache2 but it still gives the same error. Is there something else I am supposed to do as I am on Linux and they do not have php_intl.dll files.

    I downloaded using this command and maybe it got the wrong version ??

    git clone https://github.com/vanilla/vanilla.git
    


    My location in php.ini is date.timezone = Australia/Sydney


    My Error:


    Class 'Locale' not found

    The error occurred on or near: /var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php

    109: 
    110:         $populate = function (array &$row, array $locales) {
    111:             $displayNames = [];
    112:             foreach ($locales as $locale) {
    113:                 $displayName = \Locale::getDisplayLanguage($row["localeKey"], $locale);
    114: 
    115:                 // Standardize capitalization
    116:                 $displayName = mb_convert_case($displayName, MB_CASE_TITLE);
    117: 
    

    Backtrace:

    [/var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php:127] LocalesApiController->{closure}();
    [/var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php:45] LocalesApiController->expandDisplayNames();
    [/var/www/html/vanilla/library/Vanilla/Models/LocalePreloadProvider.php:36] LocalesApiController->index();
    [/var/www/html/vanilla/library/Vanilla/Web/JsInterpop/ReduxActionPreloadTrait.php:51] Vanilla\Models\LocalePreloadProvider->createActions();
    [/var/www/html/vanilla/library/core/class.controller.php:1969] Gdn_Controller->getReduxActionsAsJsVariable();
    [/var/www/html/vanilla/library/core/class.controller.php:1473] Gdn_Controller->renderMaster();
    [/var/www/html/vanilla/library/core/class.pluggable.php:217] Gdn_Controller->xRender();
    [/var/www/html/vanilla/applications/dashboard/controllers/class.setupcontroller.php:155] Gdn_Pluggable->__call();
    [/var/www/html/vanilla/library/core/class.dispatcher.php:872] SetupController->index();
    [/var/www/html/vanilla/library/core/class.dispatcher.php:289] Gdn_Dispatcher->dispatchController();
    [/var/www/html/vanilla/index.php:29] Gdn_Dispatcher->dispatch();
    

    Need Help?

    If you are a user of this website, you can report this message to a website administrator.

    If you are an administrator of this website, you can get help at the Vanilla Community Forums.

    Additional information for support personnel:

    • Application: Vanilla
    • Application Version: 4.0-2019.018-SNAPSHOT
    • PHP Version: 7.2.24-0ubuntu0.19.04.1
    • Operating System: Linux
    • Server Software: Apache/2.4.41 (Ubuntu)
    • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
    • Request Uri: /index.php?p=/dashboard/setup
    • Controller: LocalesApiController
    • Method: {closure}


  • gilesajgilesaj New
    edited December 2019

    Just in case I downloaded the wrong version I downloaded version 3.3 and I still get the same error.


    git clone --branch release/3.3 https://github.com/vanilla/vanilla.git



    Additional information for support personnel:

    • Application: Vanilla
    • Application Version: 3.3
    • PHP Version: 7.2.24-0ubuntu0.19.04.1
    • Operating System: Linux
    • Server Software: Apache/2.4.41 (Ubuntu)
    • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
    • Request Uri: /index.php?p=/dashboard/setup
    • Controller: LocalesApiController
    • Method: {closure}


  • R_JR_J Ex-Fanboy Munich Admin

    You should always use the zipped file from this page. You can find it here: https://open.vanillaforums.com/addon/vanilla-core

    The git version requires some additional build steps.

  • gilesajgilesaj New
    edited December 2019

    I downloaded the file from the link above and unzipped and put it in my /var/www/html folder as vanilla. I restarted apache2 and opened the browser and I get the same error as before. http://forum.dingo-den.com/

    I could not find a tutorial on how to install, lots of upgrades but no first time install.


    Class 'Locale' not found

    The error occurred on or near: /var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php

     99: 
    100:         $populate = function (array &$row, array $locales) {
    101:             $displayNames = [];
    102:             foreach ($locales as $locale) {
    103:                 $displayName = \Locale::getDisplayLanguage($row["localeKey"], $locale);
    104: 
    105:                 // Standardize capitalization
    106:                 $displayName = mb_convert_case($displayName, MB_CASE_TITLE);
    107: 
    

    Backtrace:

    [/var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php:117] LocalesApiController->{closure}();
    [/var/www/html/vanilla/applications/dashboard/controllers/api/LocalesApiController.php:45] LocalesApiController->expandDisplayNames();
    [/var/www/html/vanilla/library/Vanilla/Models/LocalePreloadProvider.php:36] LocalesApiController->index();
    [/var/www/html/vanilla/library/Vanilla/Web/JsInterpop/ReduxActionPreloadTrait.php:51] Vanilla\Models\LocalePreloadProvider->createActions();
    [/var/www/html/vanilla/library/core/class.controller.php:1967] Gdn_Controller->getReduxActionsAsJsVariable();
    [/var/www/html/vanilla/library/core/class.controller.php:1471] Gdn_Controller->renderMaster();
    [/var/www/html/vanilla/library/core/class.pluggable.php:217] Gdn_Controller->xRender();
    [/var/www/html/vanilla/applications/dashboard/controllers/class.setupcontroller.php:155] Gdn_Pluggable->__call();
    [/var/www/html/vanilla/library/core/class.dispatcher.php:872] SetupController->index();
    [/var/www/html/vanilla/library/core/class.dispatcher.php:289] Gdn_Dispatcher->dispatchController();
    [/var/www/html/vanilla/index.php:29] Gdn_Dispatcher->dispatch();
    

    Need Help?

    If you are a user of this website, you can report this message to a website administrator.

    If you are an administrator of this website, you can get help at the Vanilla Community Forums.

    Additional information for support personnel:

    • Application: Vanilla
    • Application Version: 3.3
    • PHP Version: 7.2.24-0ubuntu0.19.04.1
    • Operating System: Linux
    • Server Software: Apache/2.4.41 (Ubuntu)
    • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
    • Request Uri: /index.php?p=/dashboard/setup
    • Controller: LocalesApiController
    • Method: {closure}


  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited December 2019

    This looks like the issue I referenced here:


    The resolution was to install php-intl

  • gilesajgilesaj New
    edited December 2019

    If you follow the links it comes back to this post which does not solve the problem???? Linux does not have .dll files and I do not see a solution ..... I think I will just try another forum as this one does not work on Ubuntu 19

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    I'm using Ubuntu 18, and installing php-intl solved the issue.

    This looks like the version is php dependent:


    but I'm pretty sure I just did

    sudo apt-get install php-intl


  • Thank you for this fix! I am in the same boat as you with shared hosting and do not have access to install php-intl. This worked like a charm. I am back up and running. 😁

  • Thank you, @whu606 - installing php-intl (and then restarting Apache) works perfectly.

  • collee1988collee1988 Jakarta New

    same error

    but im sure last night i was change my PHP version from 7.2 to 7.4 is the main reason on my web

  • collee1988collee1988 Jakarta New
    edited August 2021

    Resolved, after inst af php intl

Sign In or Register to comment.