Creation of dynamic property CI_URI::$config is deprecated
Details
If you encounter this error in CodeIgniter with PHP versions 8.1 and 8.2, you need to make some changes in the following CodeIgniter files:
- /system/core/URI.php
- /system/core/Router.php
- /system/core/Loader.php
- /system/core/Controller.php
- /system/database/DB_driver.php
#[\AllowDynamicProperties] class CI_URI {
#[\AllowDynamicProperties] class CI_Router {
#[\AllowDynamicProperties] class CI_Loader {
#[\AllowDynamicProperties] class CI_Controller {
#[\AllowDynamicProperties] class CI_DB_driver {
After making these adjustments, reload the project. You should now observe that the CodeIgniter project runs successfully.