|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54241 PHP fails with newer fileinfo magic files
Submitted: 2011-03-13 11:29 UTC Modified: 2016-11-24 15:03 UTC
Avg. Score:4.6 ± 0.8
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:3 (42.9%)
From: olemarkus at gentoo dot org Assigned:
Status: Duplicate Package: Unknown/Other Function
PHP Version: 5.3.6RC3 OS:
Private report: No CVE-ID: None
 [2011-03-13 11:29 UTC] olemarkus at gentoo dot org
PHP fails if one use the magic file shipped with file 5.05. The reason is that newer version(s) of file use libmagic version unsupported by the one bundled with PHP

Test script:
    $fileinfo=new finfo(FILEINFO_MIME, "/usr/share/misc/magic.mgc");

Expected result:
string(26) "image/jpeg; charset=binary" 

Actual result:
Warning: finfo::finfo(): Failed to load magic database at
'/usr/share/misc/magic.mgc'. in /var/www/localhost/htdocs/fileinfo.php on line
Warning: finfo::file(): The invalid fileinfo object. in
/var/www/localhost/htdocs/fileinfo.php on line 3 bool(false)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-25 19:24 UTC] devurandom at gmx dot net
 [2016-08-26 13:56 UTC]
-Package: Filesystem function related +Package: Unknown/Other Function
 [2016-11-24 15:03 UTC]
-Status: Open +Status: Duplicate
 [2016-11-24 15:03 UTC]
See bug #66885.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jun 26 22:05:46 2022 UTC