Author Topic: PHP Fatal error: Uncaught TypeError: finfo_open() - PHP 8.2.8  (Read 2711 times)

Offline lonestar

  • Newbie
  • *
  • Posts: 6
PHP Fatal error: Uncaught TypeError: finfo_open() - PHP 8.2.8
« on: August 05, 2023, 05:56:58 PM »
Hello,

I have this error when trying to upload an attachment. PHP is 8.2.8 . It was working previously , I presume the latest PHP update triggers it.

05-Aug-2023 23:46:53 Europe/Rome] PHP Fatal error:  Uncaught TypeError: finfo_open(): Argument #2 ($magic_database) must be of type ?string, array given in /var/www/htdocs/roundcube/program/lib/Roundcube/rcube_mime.php:757
Stack trace:
#0 /var/www/htdocs/roundcube/program/lib/Roundcube/rcube_mime.php(757): finfo_open(1040, Array)
#1 /var/www/htdocs/roundcube/program/actions/mail/attachment_upload.php(108): rcube_mime::file_content_type('/tmp/phpBxxhN7', 'XXXXX.xxx', 'application/oct...')
#2 /var/www/htdocs/roundcube/program/include/rcmail.php(282): rcmail_action_mail_attachment_upload->run(Array)
#3 /var/www/htdocs/roundcube/index.php(278): rcmail->action_handler()
#4 {main}
  thrown in /var/www/htdocs/roundcube/program/lib/Roundcube/rcube_mime.php on line 757


Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: PHP Fatal error: Uncaught TypeError: finfo_open() - PHP 8.2.8
« Reply #1 on: August 06, 2023, 01:52:39 AM »
// Path to a local mime magic database file for PHPs finfo extension.
// Set to null if the default path should be used.
$config['mime_magic'] = null;

Looks like you set it to an array. It's not supported.

Offline lonestar

  • Newbie
  • *
  • Posts: 6
Re: PHP Fatal error: Uncaught TypeError: finfo_open() - PHP 8.2.8
« Reply #2 on: August 06, 2023, 08:07:21 AM »
// Path to a local mime magic database file for PHPs finfo extension.
// Set to null if the default path should be used.
$config['mime_magic'] = null;

Looks like you set it to an array. It's not supported.

you're right. Thanks.
to be honest, I've had the setting there for years. I guess times change.