Re: fileinfo on RHEL5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



brian wrote:
RHEL5/PHP 5.1.6

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
vi /etc/php.d/fileinfo.ini
extension=fileinfo.so

ln -s /usr/share/file/magic /etc/magic.mime

The code:

define('FINFO_PATH', '/usr/share/file/magic');
...
$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[1] 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?

I'm running php 5.2.9 on CentOS 5 with FileInfo 1.0.4

I have src.rpm's here:

http://www.clfsrpm.net/php/

Works well enough for me.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux