CodeIgniter Forums
ErrorException: $strictLocaleNegotiation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: ErrorException: $strictLocaleNegotiation (/showthread.php?tid=92650)



ErrorException: $strictLocaleNegotiation - Vespa - 03-22-2025

Hi, I got in trouble with my locally installed Codeigniter project.
I was developing my web site on my local PC, Windows 10 as OS...so I had installed PHP 8.3, Codeigniter using Composer and MySQL
Now I have updated PHP to 8.4.5 version...updated Composer...and when I run the command
Code:
php spark serve
I get he following error
Code:
D:\_GAVS_nuovo_sito\composer-gavs>php spark serve
PHP Fatal error:  Uncaught ErrorException: Undefined property: Config\Feature::$strictLocaleNegotiation in D:\_GAVS_nuovo_sito\composer-gavs\vendor\codeigniter4\framework\system\HTTP\Negotiate.php:131
Any hint to fix the issue? Thanks a lot for any feedback


RE: ErrorException: $strictLocaleNegotiation - warcooft - 03-22-2025

just add this property.


PHP Code:
/**
 * Use strict location negotiation.
 *
 * By default, the locale is selected based on a loose comparison of the language code (ISO 639-1)
 * Enabling strict comparison will also consider the region code (ISO 3166-1 alpha-2).
 */
public bool $strictLocaleNegotiation false

more info see https://codeigniter.com/user_guide/installation/upgrade_460.html#content-changes


RE: ErrorException: $strictLocaleNegotiation - Vespa - 03-22-2025

Warcooft, thanks a lot for your help and for taking the time to provide the invaluable feedback.
Added your code to config/Feature.php file solved the previous issue...now, when I try the php spark serve command I get the following message:
Code:
D:\_GAVS_nuovo_sito\composer-gavs>php spark serve
{
    "title": "Error",
    "type": "Error",
    "code": 500,
    "message": "Undefined constant Kint\\Renderer\\AbstractRenderer::SORT_FULL",
    "file": "D:\\_GAVS_nuovo_sito\\composer-gavs\\app\\Config\\Kint.php",
    "line": 44,
    "trace": [
        {
            "file": "D:\\_GAVS_nuovo_sito\\composer-gavs\\vendor\\codeigniter4\\framework\\system\\Autoloader\\Autoloader.php",
            "line": 532,
            "function": "[constant expression]"
        },
        {
            "file": "D:\\_GAVS_nuovo_sito\\composer-gavs\\vendor\\codeigniter4\\framework\\system\\Autoloader\\Autoloader.php",
            "line": 499,
            "function": "configureKint",
            "class": "CodeIgniter\\Autoloader\\Autoloader",
            "type": "->",
            "args": []
        },
        {
            "file": "D:\\_GAVS_nuovo_sito\\composer-gavs\\vendor\\codeigniter4\\framework\\system\\Boot.php",
            "line": 302,
            "function": "initializeKint",
            "class": "CodeIgniter\\Autoloader\\Autoloader",
            "type": "->",
            "args": [
                true
            ]
        },
        {
            "file": "D:\\_GAVS_nuovo_sito\\composer-gavs\\vendor\\codeigniter4\\framework\\system\\Boot.php",
            "line": 98,
            "function": "initializeKint",
            "class": "CodeIgniter\\Boot",
            "type": "::",
            "args": []
        },
        {
            "file": "D:\\_GAVS_nuovo_sito\\composer-gavs\\spark",
            "line": 84,
            "function": "bootSpark",
            "class": "CodeIgniter\\Boot",
            "type": "::",
            "args": [
                {
                    "systemDirectory": "D:\\_GAVS_nuovo_sito\\composer-gavs\\app\\Config/../../vendor/codeigniter4/framework/system",
                    "appDirectory": "D:\\_GAVS_nuovo_sito\\composer-gavs\\app\\Config/..",
                    "writableDirectory": "D:\\_GAVS_nuovo_sito\\composer-gavs\\app\\Config/../../writable",
                    "testsDirectory": "D:\\_GAVS_nuovo_sito\\composer-gavs\\app\\Config/../../tests",
                    "viewDirectory": "D:\\_GAVS_nuovo_sito\\composer-gavs\\app\\Config/../Views"
                }
            ]
        }
    ]
}
I thought that running "composer update" should fix the upgrade issues...but I was wrong...


RE: ErrorException: $strictLocaleNegotiation - warcooft - 03-22-2025

This is a list of all files in the project space that received changes; many will be simple comments or formatting that have no effect on the runtime:

app/Config/Cache.php
app/Config/Constants.php
app/Config/Database.php
app/Config/Feature.php
app/Config/Format.php
app/Config/Kint.php
app/Config/Routing.php
app/Config/Security.php
app/Views/errors/html/debug.css
app/Views/errors/html/error_400.php
preload.php
public/index.php
spark

you can see all missing code in vendor/codeigniter4/framework/app/Config/ folder.
all changes are clearly documented. see https://codeigniter.com/user_guide/installation/upgrade_460.html#content-changes


RE: ErrorException: $strictLocaleNegotiation - Vespa - 03-23-2025

warcooft, thanks a lot for your time and hints.