|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-02-25 19:24 UTC] devurandom at gmx dot net
[2016-08-26 13:56 UTC] cmb@php.net
-Package: Filesystem function related
+Package: Unknown/Other Function
[2016-11-24 15:03 UTC] ab@php.net
-Status: Open
+Status: Duplicate
[2016-11-24 15:03 UTC] ab@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jan 05 14:00:01 2026 UTC |
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)