安装/配置
在线手册:中文 英文
PHP手册

运行时配置

此扩展没有在 php.ini 中定义配置指令。


安装/配置
在线手册:中文 英文
PHP手册
PHP手册 - N: 运行时配置

用户评论:

sam nospam at archives.org.au (24-Mar-2010 06:03)

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.)

wade at waddles dot org (12-Aug-2008 04:18)

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