The unix command "file" is not executing the file.
From http://en.wikipedia.org/wiki/File_(command):
file is a standard Unix program for recognizing the type of data contained in a computer file using magic numbers.
The same method of checking the file type is suggested here:
http://www.php.net/manual/en/function.mime-content-type.php#91646
You can also see what the arguments -bi mean here:
http://linux.about.com/library/cmd/blcmdl1_file.htm
-b Do not prepend filenames to output lines (brief mode).
-i Causes the file command to output mime type strings rather than the more traditional human readable ones. Thus it may say text/plain; charset=us-ascii'' rather than
ASCII text''. In order for this option to work, file changes the way it handles files recognised by the command itself (such as many of the text file types, directories etc), and makes use of an alternative magic'' file. (See
FILES'' section, below).