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:xampphtdocsinv_perpusindex.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:xampphtdocsinv_perpusindex.php
Line: 288
Function: require_once
4
Answers
This is an issue with CodeIgniter.
in
/system/core/URI.php
you can add this to the top of the class to fix it:Or, you can disable deprecation warnings in one of two ways:
php.ini
in code:
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.
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
/system/core/Router.php
/system/core/Loader.php
/system/core/Controller.php
/system/database/DB_driver.php
change this
error_reporting(-1);
ini_set(‘display_errors’, 1);
to
error_reporting(0);
ini_set(‘display_errors’, 0);
in index.php in codeigniter
welcome……