Errors in PHP 8.3.6 Creation of dynamic property CI_URI::$config is deprecated

I am getting errors after install. Any suggestions on how to fix this?

“Creation of dynamic property CI_URI::$config is deprecated”

“Creation of dynamic property CI_DB_mysqli_driver::$failover is deprecated”

Do I need to downgrade php to an older version?

Hi there, welcomd,

CodeIgniter, which is what InvoicePlane was built upon is NOT compatible with PHP 8.2 and beyond.

We’ve prepared InvoicePlane just in case that ever happens.

You’re in luck. Someone made a pull-request which would make InvoicePlane work with PHP 8.3 (In your caae)
It should be a fairly easy fix: CodeIgniter3 for php-8.2+ and maintained by pocketarc by sudwebdesign · Pull Request #1161 · InvoicePlane/InvoicePlane · GitHub

  • adjust composer.json for a maintained version of CodeIgniter (and composer update
  • adjust index.php for that maintained version of CodeIgniter
  • 1 or 2 fixes in InvoicePlane’s codebase

We have 1 more version to go (version 1.6.3) and then we’ll release a beta version with that PR merged

Hope it helps!

I do not understand what you are saying? Do I need to install Codeigniter3? How do I adust compose.json? Help is appreciated.

1 Like

In order for InvoicePlane to work with PHP 8.3 i would do the following:

  • open `composer.json
  • replace "codeigniter/framework": "3.1.13", with "pocketarc/codeigniter": "3.3",
  • run composer update
  • open application/libraries/MY_Form_validation.php
    Apply the changes you see in the pull-request. This should be your new code:
    function run($config = null, &$data = null)
    {
        (is_object($config)) AND $this->CI = &$config;
        return parent::run($data);
    }

Open index.php:

  • Replace $system_path = 'vendor/codeigniter/framework/system'; with
    $system_path = 'vendor/pocketarc/codeigniter/system';

  • Replace error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); with ~error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);`

Keep looking at this pull-request for your example, it has tk look exactly like this:

Only application/third_party/MX/Controller.php doesn’t need to be changed, that was only differences in spaces.

Disclaimer:
Until InvoicePlane is on version PHP 8.3 we can only help you once in a while.
But i hope by copying these few lines and running composer update you won’t run into any problems for a while…

did the same mistake (on php 8.1.12), and maybe found an easy way to fix “Creation of dynamic property … is deprecated” temporarily.

according to stackoverflow you need just to allow dynamic properties:

add in this two files #[\AllowDynamicProperties] above the class

\ip\vendor\codeigniter\framework\system\core\URI.php
(line 53)

#[\AllowDynamicProperties]

class CI_URI {

\ip\vendor\codeigniter\framework\system\database\DB_driver.php
(line 54)

#[\AllowDynamicProperties]

abstract class CI_DB_driver {

Codeigniter 3 is incompatible with PHP 8.2+ abd therefore also PHP8.3

See all the unmerged pull-requests on their github.

Someone made a fork of CodeIgniter to make it compatible with PHP 8.2+ and therefore PHP 8.3

We’ll adopt that fork after we release 1.6.3

Roadmap:
1.6.3 => e-invoicing
1.7.0 => compatibility with PHP 8.2 and PHP 8.3

1 Like