FileInfo extension error (Windows)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Benzari.Alex@gmail.com

    FileInfo extension error (Windows)

    What I want to do is use the FileInfo module as described in PHP
    Architect's guide to security

    I installed the extension under linux and it works just fine... and i
    tried to install it on my windows machine that i use as a debug server
    before posting the site on the Internet.

    I installed the extension for php 5.1.2 from
    http://pecl4win.php.net/list.php and created a php as described in the
    PHP manual:

    <?php
    $finfo = finfo_open(FILE INFO_MIME); // return mime type ala mimetype
    extension
    foreach (glob("*.*") as $filename) {
    echo $filename;
    echo finfo_file($fin fo, $filename) . "\n<br/>";
    }
    finfo_close($fi nfo);
    ?>

    When i try to run the script I get the just the list of files and the
    following error in the Apache Logs:

    [Wed Apr 26 13:31:26 2006] [error] [client 127.0.0.1] PHP Warning:
    finfo_open() [<a href='function. finfo-open'>function. finfo-open</a>]:
    Failed to load magic database at '(null)'. in
    I:\\WWW\\Apache 2\\www\\docs\\j oin\\testFileIn fo.php on line 2

    Can anyone please help me??

Working...