Bug #54241 [Com]: PHP fails with newer fileinfo magic files
| From: | devurandom at gmx dot net | Date: | Tue, 25 Feb 2014 19:24:51 +0000 |
| Subject: | Bug #54241 [Com]: PHP fails with newer fileinfo magic files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184431@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54241&edit=1
ID: 54241
Comment by: devurandom at gmx dot net
Reported by: olemarkus at gentoo dot org
Summary: PHP fails with newer fileinfo magic files
Status: Open
Type: Bug
Package: Filesystem function related
PHP Version: 5.3.6RC3
Block user comment: N
Private report: N
New Comment:
See-Also: https://bugs.php.net/bug.php?id=66095
Previous Comments:
------------------------------------------------------------------------
[2011-03-13 11:29:18] olemarkus at gentoo dot org
Description:
------------
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:
---------------
<?php
$fileinfo=new finfo(FILEINFO_MIME, "/usr/share/misc/magic.mgc");
var_dump($fileinfo->file("/tmp/test.jpg"));
?>
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
2
Warning: finfo::file(): The invalid fileinfo object. in
/var/www/localhost/htdocs/fileinfo.php on line 3 bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54241&edit=1