I'm having some trouble getting the Fileinfo package working. It
installed fine, and phpinfo() says it's enabled. But it consistently
returns an empty string when getting the MIME of a file.
/usr/share/pear/bin/pecl install fileinfo
ln -s /usr/share/file/magic /etc/magic.mime
$fi = new finfo(FILEINFO_MIME, FINFO_PATH);
$type = $fi->file($file_path);
$type is always empty. And, yes, the path to the file is good.
This works fine on the dev box (PHP 5.2.6). Unfortunately, the decision
to use RHEL5 for production was out of my hands and I'm stuck with this
older version. At least, I'm thinking it might be due to that. I didn't
see anything in the manual about it, though.
I did come across a post online about doing file conversions where
the guy mentions rolling an upgrade to 5.2.4 for RHEL5 but wasn't
specific as to whether it was necessary to get Fileinfo to work at all.
I might try using that upgrade but thought I'd do a sanity check here
first. Any other reason it'd be returning nothing?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php