In response to the suggestion from "jon at cybus" below to symlink /usr/share/file/magic to /etc/magic.mime, note that this causes other problems (in Debian Etch, anyway). It breaks the -i functionality of the file command, causing it to return the human-readable string instead of the MIME type. It also results in finfo doing the same.
So, it is probably better to actually specify the path to the magic file correctly when instantiating your finfo object:
$fi = new finfo(FILEINFO_MIME,'/usr/share/file/magic');
$mime_type = $fi->buffer(file_get_contents($file));
Of course, you still end up with something that cannot tell the difference between a Word document and an Excel spreadsheet.