VersionedDirectoryIterator::current() must be compatible with DirectoryIterator::current()

Hi folks,
I’m trying to install omeka on a fresh server and I got this error after instalation:

Fatal error : Declaration of VersionedDirectoryIterator::current() must be compatible with DirectoryIterator::current(): mixed in /var/www/html/omeka/application/libraries/VersionedDirectoryIterator.php on line 38

Here is my configuration:
http://ec2-54-235-26-162.compute-1.amazonaws.com/version.php

How can I fix this?

This is an issue with PHP 8.1: we haven’t yet released a version that supports PHP 8.1 (though the in-development Git master branch supports it).

1 Like

It’s also worth noting that the specific “Fatal error” here is actually a bug in PHP that they’ve fixed. I believe version 8.1.5 is the first one with the fix.

Hi, I am facing the same issue while trying to install Omeka on a fresh server.

Fatal error : Declaration of VersionedDirectoryIterator::current() must be compatible with DirectoryIterator::current(): mixed in /var/www/html/omeka/application/libraries/VersionedDirectoryIterator.php on line 38

I used Omeka v3.0.3 and php v8.1.2

On reading in this thread that this error could be related to a bug in PHP, I downgraded PHP to 7.2.34-33+ubuntu22.04.1+deb.sury.org+1. Now, I am getting a different error.

Fatal error : Uncaught Zend_Db_Adapter_Mysqli_Exception: The server requested authentication method unknown to the client in /var/www/html/omeka/application/libraries/Zend/Db/Adapter/Mysqli.php:340 Stack trace: #0 /var/www/html/omeka/application/libraries/Zend/Db/Adapter/Mysqli.php(549): Zend_Db_Adapter_Mysqli->_connect() #1 /var/www/html/omeka/application/libraries/Omeka/Db.php(322): Zend_Db_Adapter_Mysqli->getServerVersion() #2 /var/www/html/omeka/application/libraries/Omeka/Db.php(56): Omeka_Db->_getInitCommand() #3 /var/www/html/omeka/application/libraries/Omeka/Application/Resource/Db.php(64): Omeka_Db->_construct(Object(Zend_Db_Adapter_Mysqli), 'omeka’) #4 /var/www/html/omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(695): Omeka_Application_Resource_Db->init() #5 /var/www/html/omeka/application/libraries/Zend/Application/Bootstrap/BootstrapAbstract.php(638): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource(‘db’) #6 /var/www/html/omeka/application/libraries/Zend/Application in /var/www/html/omeka/application/libraries/Zend/Db/Adapter/Mysqli.php on line 340

Any suggestions on how to fix this?

The “authentication method unknown to the client” issue is related to your version of MySQL and the client MySQL library used by your version of PHP.

Using PHP 7.4 instead should resolve this.

This topic was automatically closed after 250 days. New replies are no longer allowed.