I'm also having trouble with Fileinfo. I'm pretty sure I have it installed but can't be certain:
server: pecl install -f Fileinfo
BLAH
BLAH
BLAH
.
.
.
Build process completed successfully
Installing '/usr/lib/php5/20060613+lfs/fileinfo.so'
install ok: channel://pear.php.net/Fileinfo-1.0.4
server:/home/jaith/public#
And yet the finfo functions are not defined in php even after apache restart. This code results in "Fatal error: Call to undefined function finfo_file() in /home/sneakyimp/public/chump.php on line 29":
<?php
$filename = '/home/sneakyimp/public/war3.jpg';
$magic_file = '/usr/share/file/magic.mime';
$finfo = finfo_open(FILEINFO_MIME, $magic_file); // return mime type ala mimetype extension
if (!$finfo) {
echo "Opening fileinfo database failed";
exit();
}
/* get mime-type for a specific file */
echo finfo_file($finfo, $filename);
/* close connection */
finfo_close($finfo);
?>
I've also tried the object-oriented style without any luck.