Bug #54241 [Opn->Dup]: PHP fails with newer fileinfo magic files

From: Date: Thu, 24 Nov 2016 15:03:34 +0000
Subject: Bug #54241 [Opn->Dup]: PHP fails with newer fileinfo magic files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205612@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 Updated by: ab@php.net Reported by: olemarkus at gentoo dot org Summary: PHP fails with newer fileinfo magic files -Status: Open +Status: Duplicate Type: Bug Package: Unknown/Other Function PHP Version: 5.3.6RC3 Block user comment: N Private report: N New Comment: See bug #66885. Thanks. Previous Comments: ------------------------------------------------------------------------ [2014-02-25 19:24:50] devurandom at gmx dot net See-Also: https://bugs.php.net/bug.php?id=66095 ------------------------------------------------------------------------ [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

« previous php.bugs (#205612) next »