Bug #54241 [NEW]: PHP fails with newer fileinfo magic files

From: Date: Sun, 13 Mar 2011 10:29:23 +0000
Subject: Bug #54241 [NEW]: PHP fails with newer fileinfo magic files
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159448@lists.php.net to get a copy of this message
From: Operating system: PHP version: 5.3.6RC3 Package: Filesystem function related Bug Type: Bug Bug description:PHP fails with newer fileinfo magic files 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 bug report at http://bugs.php.net/bug.php?id=54241&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54241&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54241&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54241&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54241&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54241&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54241&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54241&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54241&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54241&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54241&r=support Expected behavior: http://bugs.php.net/fix.php?id=54241&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54241&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54241&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54241&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54241&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54241&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54241&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54241&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54241&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54241&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54241&r=mysqlcfg

« previous php.bugs (#159448) next »