jbodoni has asked for the wisdom of the Perl Monks concerning the following question:

For many, their initial response will be to change my environment. If I could get this working in a LAMP environment, I would.. but I'm stuck with Windows 7, IIS, and Strawberry Perl.

Per the documentation, I've downloaded file 4.x or file 5x and the associated libmagic library and headers (http://darwinsys.com/file/). What I don't know is what to do with those files. If anyone has managed to successfully get this working in this type of environment, I'd like to hear from you.

Thank you.

  • Comment on Installing File::LibMagic with Strawberry Perl

Replies are listed 'Best First'.
Re: Installing File::LibMagic with Strawberry Perl
by Corion (Patriarch) on Jun 26, 2015 at 19:33 UTC

    You will need to compile the libraries for your system. This is mostly a C task, and if you have no experience compiling C libraries, this will be some learning experience for you. As the build scripts seem to be built using autoconf, there is little hope of getting the automatism to work on Windows, so you will have to do the configuration and compilation yourself, manually.

    After you've successfully configured and compiled the library, you then have to point the Makefile.PL in File::LibMagic to the headers of the library and that should be it.

    Personally, I would look at other libraries that determine the magic type of files, for example File::MimeInfo::Magic or File::MMagic.

      Thanks for your reply!

      CGI::Application relies on this module, which started me down this rabbit hole.

        I'm pretty sure it doesn't, can you point me to where you're seeing this please?

        Update: It doesn't.