Platform: WinXP-SP2, PHP5.2.5, MySQL 5.0, Apache 2.2.8
After reading former notes, I wasn't able to load my magic database: 'magic.mime' file (donwloaded from GnuWin32 project, zipped with the binary files v4.21). I always got an invalid $finfo object or finfo_open(...) returned FALSE.
In order to be able to load the 'magic.mime' file, Fileinfo library (bundled in PHP5.2.5) also requires 'magic' file.
For example:
1. Database:
c:phpmagic.mime
c:phpmagic
2. PHP Code:
$filname='c:phpphp.ini';$finfo= newfinfo(FILEINFO_MIME,'c:phpmagic');
if (!$finfo) returnfalse;
echo$finfo->file($filename);?>
For further info see: http://pecl.php.net/bugs/bug.php?id=7555
Pay attention to comments added by 'christophe dot charron dot xul at gmail dot com'
NOTE: Before upgrading to PHP5.2.5, I was working with PHP5.2.1 and it only required 'magic.mime' file.