Failed to load magic database

elbarto

Verified User
Joined
Oct 8, 2008
Messages
134
Hi guys... I've been having this problem for a couple of days, I googled a lot and couldn't find a definitive solution.

I'm getting the following error with Fileinfo PECL extension on PHP 5.2.13:

Code:
Warning: finfo_open(): Failed to load magic database at '/usr/share/misc/magic'. in /root/mime.php on line 2

The file /root/mime.php has the following:

Code:
<?php
$fp = finfo_open(FILEINFO_MIME);
if (!$fp) {
    echo "Failed to open database\n";
    exit(1);
}
echo $fp->file(__FILE__);
?>

/usr/share/misc/magic is a symlink to /usr/share/magic which is a symlink to /usr/share/file/magic. I tried changing the permissions of the file, but nothing happens.

Any ideas?

Thanks!
 
Hi,

I also have the same issue. How to solve it? Is the fileinfo need to be updated or configured? Or is it the magic file need to be updated? How can I do that? Can anyone help?

Thank you very much for your help.

Best regards,
 
Back
Top