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

search for in the

実行時設定> <要件
[edit] Last updated: Fri, 10 Feb 2012

view this page in

インストール手順

この拡張モジュールは、PHP 5.3.0 以降デフォルトで有効となります。 それまでは fileinfo は PECL 拡張モジュールでしたが、もう PECL ではメンテナンスされていません。 5.3 より前のバージョンでは、 » メンテナンスが終了した PECL 拡張モジュール を使うこともできます。

Windows ユーザがこの拡張モジュールを使うには、同梱されている DLL ファイル php_fileinfo.dllphp.ini で有効にしなければなりません。

libmagic ライブラリは PHP に同梱されていますが、PHP 用に変更されています。 libmagic へのパッチは libmagic.patch で、これは PHP fileinfo 拡張モジュールのソースの中に含まれています。

同梱されている libmagic ライブラリの更新履歴
PHP バージョン libmagic バージョン 注意
5.3.2 5.03  
5.3.0 5.02  



実行時設定> <要件
[edit] Last updated: Fri, 10 Feb 2012
 
add a note add a note User Contributed Notes インストール手順
mdahlke at pixelcarve dot com 26-Jul-2010 06:24
I found that while using the magic files from GnuWin 4.23 worked great for the PECL extension with PHP 5.2 on Win32, when I started migrating to PHP 5.3 all of a sudden Fileinfo no longer worked.  Updating the magic files to the latest version (4.26 at the time of this writing) worked like a charm. 

I guess the bundled version of Fileinfo uses the new mime magic format while the old PECL version uses the old format.
darko at uvcms dot com 28-Jun-2008 05:04
I need to add an addendum to the previous instalation steps.

Recently gnuwin32 project made a new release of file package (4.24). Binary release does not contain all needed magic files for fileinfo extension.
Instead of downloading latest version of file package (4.24) just get previous one (4.23) which does contain all of the needed files.
darko at uvcms dot com 16-Apr-2008 11:35
It is really strange to find that installing filenfo extension on windows is not yet fully explained. Here are the latest most up-to-date steps to make this work:

1. Add php_fileinfo.dll to the list of enabled extensions
extension=php_fileinfo.dll

2. Download GNU file package for windows
get it from here: http://gnuwin32.sourceforge.net/downlinks/file-bin-zip.php

Extract the folder from the archive called shared\file which contains 4 magic files (magic, magic.mgc, magic.mime, magic.mime.mgc).

3. Place these 4 files in a known place

4. Add system enviroment variable MAGIC that points to the file called magic. For example if you placed magic files in folder called magic in c:\php that means that the propper path is c:\php\magic\magic

5. If you use IIS restart it and fileinfo is ready for use

5a. If you use apache you will have to restart operating system for the service to acknowledge MAGIC env. variable.

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