1 (edited by hata_ph 2014-05-23 10:38:04)

Topic: PHP Warning: finfo_open(): Failed to load magic database

======== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: CentOS 6.5
- Related log if you're reporting an issue:
====

I have upgrade roundcubemail from 0.9.5 to 1.0.1 recently and I notice below error popping up at maillog from time to time

May 23 10:04:47 mail roundcube: PHP Warning:  finfo_open(): Failed to load magic database at '/usr/share/misc/magic'. in /var/www/roundcubemail-1.0.1/program/lib/Roundcube/rcube_mime.php on line 743

It seem like the solution is to turn off using external magic database
http://trac.roundcube.net/ticket/1489259

I do have /usr/share/misc/magic in my centos 6.5

[root@mail misc]# pwd
/usr/share/misc
[root@mail misc]# ls -all
total 2344
drwxr-xr-x.  2 root root    4096 Mar 11  2013 .
drwxr-xr-x. 74 root root    4096 Feb 27 09:40 ..
-rw-r--r--   1 root root  600714 Oct  4  2012 magic
-rw-r--r--   1 root root 1786800 Oct  4  2012 magic.mgc
[root@mail misc]

this is my roundcubemail config setting under config.inc.php

// Path to a local mime magic database file for PHPs finfo extension.
$config['mime_magic'] = '/usr/share/misc/magic';

Do I need magic database for iRedMail and what does it do?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: PHP Warning: finfo_open(): Failed to load magic database

hata_ph wrote:

Do I need magic database for iRedMail and what does it do?

It's used in PHP web applications, in this case, it's Roundcube webmail. It's better to ask in Roundcube mailing list to understand what it's used for in Roundcube.

3

Re: PHP Warning: finfo_open(): Failed to load magic database

I change to below settings and no more error appear

$config['mime_magic'] = '/usr/share/misc/magic.mgc';

or

$config['mime_magic'] = null;

I notice roundcubemail's default settings also use null as default

I try on a new install of iRedMail-0.8.7 on centos 6.5 and notice it use null too so I believe the mime_magic settings is inherit from previous version of iRedMail/roundcubemail configuration...

http://us3.php.net/manual/en/function.finfo-open.php
https://issues.kolab.org/show_bug.cgi?id=1171