Once again about an empty screen

Hi all !
I have tried to install Wacko for testing and received an empty screen. I read here about such problems, but I did not see the solution to my issue.
The whole set looks like this -
Windows10 + latest XAMPP 8.2.12 (Apache/2.4.58 (Win64), PHP/8.2.12, 10.4.32-MARIADB) + Wacko 6.1.25 = empty screen.
Next, I try to install versions lower and get 6.1.3 works successfully. Then I try upgrade it to 6.1.4 and I get an empty screen again. The same empty screen is obtained by fresh installation 6.1.4.
Is it possible to rise to 6.1.25 (and go on) in this configuration?
Thanks.

Comments

  1. Re: Once again about an empty screen

    Please activate the debug mode in your constant.php file, run the installer again, and report what the PHP error log is telling you.

    Turning PHP error reporting in config/constants.php on.
    const DB_ERROR_MODE				= 1;
    const PHP_ERROR_REPORTING			= 6;	

    An empty screen usually means a Fatal error.

    tmp folder for XAMPP Windows

    The default tmp/ folder for XAMPP Windows resides under C:\xampp\tmp.

    define('CACHE_SESSION_DIR', '/xampp/tmp');


    There is probably a missing PHP extension (intl) or similar or an environment configuration issue.

    • Stop XAMPP and remove the starting semicolon ( ; ) from your xampp/php/php.ini the following code.
       ;extension=php_intl.dll	
      Restart XAMPP.

    Please check if you've activated the intl extension, for some reason in XAMPP for Windows it is not enabled by default.

    The latest WackoWiki version is well tested. Do not use old versions.

    You can of course update your Wiki with the installer from 6.1.3 to 6.1.25.
    WackoWiki 6.1.4 introduces the IntlDateFormatter (see log).
    • WikiAdmin
    • 06.09.2024 04:39 edited
  2. Ответ: Once again about an empty screen

    Hi WikiAdmin.
    I checked (intl), it is OK.
    Then I made an upgrade from the working new Wiki 6.1.3 to 6.1.25. The whole process went smoothly. When switching to the wiki with pHP_error_Reporting = 6 I got this :
     
    <br />
    <b>Fatal error</b>:  Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR in D:\xampp\htdocs\wikieng\class\wacko.php:536
    Stack trace:
    #0 D:\xampp\htdocs\wikieng\class\wacko.php(536): IntlDateFormatter-&gt;__construct('C', 0, 0, 'UTC', NULL, 'dd.MM.yyyy HH:m...')
    #1 D:\xampp\htdocs\wikieng\class\wacko.php(527): Wacko-&gt;date_format(1725022457, 'dd.MM.yyyy HH:m...')
    #2 D:\xampp\htdocs\wikieng\class\wacko.php(5425): Wacko-&gt;sql_time_format('2024-08-30 12:5...')
    #3 D:\xampp\htdocs\wikieng\class\templatestfilters.php(69): Wacko-&gt;{closure}('2024-08-30 12:5...')
    #4 D:\xampp\htdocs\wikieng\class\templatestsetter.php(52): TemplatestFilters-&gt;call_filter('time_format', '2024-08-30 12:5...', Array)
    #5 D:\xampp\htdocs\wikieng\class\templatestuser.php(269): TemplatestSetter-&gt;assign(Array, Array, '2024-08-30 12:5...')
    #6 D:\xampp\htdocs\wikieng\class\templatestuser.php(242): TemplatestUser-&gt;{closure}(Array, Array, Array, 'modHide')
    #7 D:\xampp\htdocs\wikieng\class\templatestuser.php(279): TemplatestUser-&gt;{closure}(Array, Array, Array)
    #8 D:\xampp\htdocs\wikieng\class\templatestuser.php(138): TemplatestUser-&gt;set('modHide_time', '2024-08-30 12:5...')
    #9 D:\xampp\htdocs\wikieng\theme\default\appearance\footer.php(31): TemplatestUser-&gt;__set('modHide_time', '2024-08-30 12:5...')
    #10 D:\xampp\htdocs\wikieng\class\wacko.php(5438): include('D:\\xampp\\htdocs...')
    #11 D:\xampp\htdocs\wikieng\class\wacko.php(5477): Wacko-&gt;include_buffered('footer.php', 'Theme is corrup...', '', 'theme/default/a...')
    #12 D:\xampp\htdocs\wikieng\class\wacko.php(7635): Wacko-&gt;theme_template('footer', '')
    #13 D:\xampp\htdocs\wikieng\index.php(64): Wacko-&gt;run('HomePage', 'show')
    #14 {main}
      thrown in <b>D:\xampp\htdocs\wikieng\class\wacko.php</b> on line <b>536</b><br />	

    I don't understand what does it mean.
  3. Re: Once again about an empty screen | error source

    The culprit: U_ILLEGAL_ARGUMENT_ERROR
    Fatal error:  Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR in D:\xampp\htdocs\wikieng\class\wacko.php:536
    Stack trace:
    #0 D:\xampp\htdocs\wikieng\class\wacko.php(536): IntlDateFormatter-&gt;__construct('C', 0, 0, 'UTC', NULL, 'dd.MM.yyyy HH:m...')	

    IntlDateFormatter constructor throws an exception for unknown locales since 8.1.25

    Somehow your installation passes C (un'C'onfigured) as local, but it should be something like en_US.utf8.

    PHP 8.0: Backward Incompatible Changes
    The default locale on startup is now always "C". No locales are inherited from the environment by default. Previously, LC_ALL was set to "C", while LC_CTYPE was inherited from the environment. However, some functions did not respect the inherited locale without an explicit setlocale() call. An explicit setlocale() call is now always required if a locale component should be changed from the default.	


    Its a setlocale() issue. I assume the value is missing due to an old or outdate cached system default.

    In Wacko class set_language():
    $this->lang['locale'] = setlocale(LC_CTYPE, 0);

    If you modify the lines in /etc/apache2/envvars as follows ...
    ## The locale used by some modules like mod_dav
    # export LANG=C
    ## Uncomment the following line to use the system default locale instead:
    . /etc/default/locale	

    and restart Apache. Then Apache will use the locale and language settings from your operating system.
    https://stackoverflow.com/ques[...]ales-value-come-from

    Please try to delete the config cache, restart your XAMPP so it will take the new value. Guess this should do it, but I'm not sure – having no Windows OS at hand for testing.

    On my Linux machine with XAMPP all works as expected.

    For a possible fix see comment below.
    • WikiAdmin
    • 12.09.2024 07:43 edited
  4. Re: Once again about an empty screen | Patch

    Replace in Wacko class function set_language():
    <?php
    // ...
    
    $this->lang['locale'] = setlocale(LC_CTYPE, 0);

    with this possible FIX:
    <?php
    //...
    
    /*
     * Check for a valid system locale, and override if invalid or set to 'C' which means 'unconfigured'
     * It will be overridden later via language-selection operations anyway, but a valid default must be set for Intl class methods to work
     */
    $this->lang['locale'] = setlocale(LC_CTYPE, 0);
    
    if ($this->lang['locale'] === false || $this->lang['locale'] === 'C')
    {
        $this->lang['locale'] = setlocale(LC_CTYPE, ['en_US', 'en_US.UTF-8', 'en-US', 'en']);
    }


    diff --git a/src/class/wacko.php b/src/class/wacko.php
    index 7d3d540..77e7ff2 100644
    --- a/src/class/wacko.php
    +++ b/src/class/wacko.php
    @@ -668,7 +668,16 @@
     
                 mb_internal_encoding('utf-8');
     
    +            /*
    +             * Check for a valid system locale, and override if invalid or set to 'C' which means 'unconfigured'
    +             * It will be overridden later via language-selection operations anyway, but a valid default must be set for Intl class methods to work
    +             */
                 $this->lang['locale'] = setlocale(LC_CTYPE, 0);
    +            
    +            if ($this->lang['locale'] === false || $this->lang['locale'] === 'C')
    +            {
    +                $this->lang['locale'] = setlocale(LC_CTYPE, ['en_US', 'en_US.UTF-8', 'en-US', 'en']);
    +            }
             }
     
             if ($set_translation)


    Untested!

    AND 
    Looks like the PHP team are finally reinstating support for the default 'C' locale in PHP 8.2.15

    ext/intl accept C as acceptable locale argument

    • WikiAdmin
    • 09.09.2024 08:26 edited
Log in or create an account to post a comment.