A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 102
Backtrace:
File: C:\xampp\htdocs\inv_perpus\index.php Line: 288 Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 102
Backtrace:
File: C:\xampp\htdocs\inv_perpus\index.php Line: 288 Function: require_once
I think a better way is to implement #[\AllowDynamicProperties]
Easier and much shorter.
In all the above mentioned classes add #[\AllowDynamicProperties] above class xxxxxx {
I give you my changes:
/system/core/URI.php
#[\AllowDynamicProperties]
class CI_URI {
/system/core/Router.php
#[\AllowDynamicProperties]
class CI_Router {
/system/core/Loader.php
#[\AllowDynamicProperties]
class CI_Loader {
/system/core/Controller.php
#[\AllowDynamicProperties]
class CI_Controller {
/system/database/DB_driver.php
#[\AllowDynamicProperties]
abstract class CI_DB_driver {
Source: https://github.com/bcit-ci/CodeIgniter/pull/6193#issuecomment-1397221543
ERR_CONTENT_DECODING_FAILED 200
error, which I resolved by setting in php.ini zlib.output_compression=On
see: https://mcmap.net/q/470899/-ajax-returning-err_content_decoding_failed-200-using-codeigniter –
Xanthippe This is an issue with CodeIgniter.
in /system/core/URI.php
you can add this to the top of the class to fix it:
/**
* CI Config
*
* @var CI_Config
*/
public $config;
Or, you can disable deprecation warnings in one of two ways:
php.ini
error_reporting = E_ALL & ~E_DEPRECATED
in code:
ini_set('error_reporting', E_ALL & ~E_DEPRECATED);
of course it is bad practice to disable these errors, as these errors should be heard loudly and fixed quickly.
I opened an issue with CodeIgniter and opened a pull-request to resolve this for you in their next release. They should be onto it relatively quickly and release a patch soon thereafter so just let the course of it play out and silence the error for now
This issue is resolved in CodeIgniter 4 however
Also not a best practice, but instead of set the error reporting, in my case it was better solution to simply added an @ charachter to the beginning of each reported lines.
© 2022 - 2024 — McMap. All rights reserved.