I’m moving my installation of IP from an old server (with 1.5, PHP 7) to a new one (with 1.6, PHP 8.1). Database has been migrated, folder has been copied, instructions on Update InvoicePlane - InvoicePlane Wiki followed. When loading the setup page, I get:
Fatal error: Declaration of CI_SessionWrapper::open(string $save_path, string $name): bool must be compatible with SessionHandlerInterface::open($save_path, $name) in /srv/www/mysite/vendor/codeigniter/framework/system/libraries/Session/PHP8SessionWrapper.php on line 59
Not sure what to do with that - I’m not exactly good at PHP. I read some things online about telling things to expect changed types, but I don’t feel overly comfortable with touching CodeIgniter files.
Full message:
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /srv/www/mysite/vendor/codeigniter/framework/system/libraries/Session/PHP8SessionWrapper.php:50)
Filename: core/Common.php
Line Number: 571
Backtrace:
A PHP Error was encountered
Severity: Compile Error
Message: Declaration of CI_SessionWrapper::open(string $save_path, string $name): bool must be compatible with SessionHandlerInterface::open($save_path, $name)
Install a completely new InvoicePlane v1.6.1 on that new server, grab the .zip from the invoiceplane.com website or from the github 'releases page (they’re the same)
Empty database
make sure that it works first
Also: make sure the new server has PHP version 8.1, not 8.2
I created a new database and db user, new vhost with freshly unzipped 1.6.1, bare minimum settings in ipconfig.php. Exact same error in the exact same files/lines when visiting https://url/setup.
This is on FreeBSD 14.1-RELEASE, php-fpm, nginx, mysql. I didn’t mess with php’s default settings except setting the UNIX socket + perms and cgi.fix_pathinfo=0 (I don’t remember what it was for, only that I documented it on my old machine that it was required on the old vhost).
Update on this: the issue is that php no longer (?) likes that an interface does not explicitly declare the types of the arguments in the function definitions.
If in SessionHandlerInterface I change:
public function open($save_path, $name);
into:
public function open(string $save_path, string $name);
The error goes away. But of course it then barfs on the very next function. I don’t feel like rewriting every single interface to be specific.
I don’t know PHP well enough, but… is there a setting to stop it from being so anal about this? I mean, besides the fact that I never understood the concept of creating an interface without specifying the types, but that’s a whole other discussion.
Well, here we are. It appears that the problem is that php-session wasn’t installed. Onwards to the next step.
Oh, and php-filter as well.
Maybe something to add to the requirements web page (for FreeBSD specific, perhaps, since apparently Linux usually bundles and enables those by default)