downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Resource Types> <Installation
[edit] Last updated: Wed, 22 May 2013

view this page in

Runtime Configuration

This extension has no configuration directives defined in php.ini.



add a note add a note User Contributed Notes Runtime Configuration - [2 notes]
up
0
sam nospam at archives.org.au
3 years ago
In addition to
 extension=fileinfo.so
I also had to add
 mime_magic.magicfile=/usr/share/file/magic
to my php configuration.  Then, I instantiate Finfo thus:

<?php
$mimeMagicFile
= get_cfg_var('mime_magic.magicfile');
$finfo = new finfo(FILEINFO_MIME, $mimeMagicFile);
?>

(This is despite the rumours I hear about the default being exactly what I set it to anyway.)
up
0
wade at waddles dot org
4 years ago
On Ubuntu Feisty, you need to add the line

extension=fileinfo.so

to your /etc/php5/*/php.ini files. The extension gets linked at compile time to /usr/lib/libmagic.so.1 which uses a MAGIC environment variable which defaults to

/etc/magic:/usr/share/file/magic

 
show source | credits | sitemap | contact | advertising | mirror sites