I’m trying to setup an Omeka instance on my local computer.
I’ve used XAMPP to creare a webserver, then created a database with a user with complete access. But, when I try launchin Omeka configuration, I receive the following:
I thought the issue was coming from the db engine (XAMPP defaults to InnoDB), but after setting the mysql config file to use MyISAM instead and restarting the server nothing has changed.
Has anybody come across the same issue, or can offer me a solution?
Omeka Classic installs (almost) all its tables as InnoDB anyway so that shouldn’t be the issue.
The odd thing is that “omeka_options doesn’t exist” is generally the indicator to the system that it should redirect to the installer, so you typically don’t see this error. I think maybe the relevant factor is that mysqli threw an exception here instead of what it normally does, report the error through its own internal system.
The Zend Framework database code we use doesn’t expect mysqli to throw exceptions, so it causes some issues. Looking into it, it looks like maybe this is a problem specific to PHP 8.1, which changes the default error-reporting mode of mysqli. Are you using PHP 8.1 there?
After implementing the fix, the installation run smoothly and was completed, thanks.
However, if I now try to visit either the public or the admin side, there’s a new issue:
Omeka has encountered an error
Zend_Session_Exception
Zend_Session::start() - C:\xampp\htdocs\omeka\application\libraries\Zend\Db\Table\Rowset\Abstract.php(Line:368): Error #8192 Return type of Zend_Db_Table_Rowset_Abstract::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Zend_Session_Exception: Zend_Session::start() - C:\xampp\htdocs\omeka\application\libraries\Zend\Db\Table\Rowset\Abstract.php(Line:368): Error #8192 Return type of Zend_Db_Table_Rowset_Abstract::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\omeka\application\libraries\Zend\Session.php:509
This is something that’s also fixed in the upcoming version: there are many PHP 8.1 incompatibilities it addresses.
Generally PHP 8.1 things are in the realm of warnings, and when they cause problems, just turning off error display (“development” mode) will allow things to work even without fixes to the code. Though I think in this case, the Zend code is catching this warning from the session component and treating it as an error, so turning off error display isn’t effective here.
Switching to PHP 8.0 or older is the simplest solution. Running the Github “master” branch code will also resolve the issue but you might not find that an appropriate option.