|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: olemarkus at gentoo dot org
New email:
PHP Version: OS:


 [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: Mon Jul 04 20:04:06 2022 UTC