I have a dev server (LFS) which uses magic MIME (installed that a long time ago, but I don't recall any problems), and it works fine. As for my production server (FreeBSD) I can't get magic MIMEs to work properly in any fashion. I've tried a lot, so I'm going to try and compress it as much as possible:
I upgraded Apache and PHP (and all dependencies, afaik).
Using the constant FILEINFO_MIME_TYPE results in notices that the constant is not defined. Which is odd on its own! However, using FILEINFO_MIME I get some useful warnings.
Now, it tells me:
I tried loading the other files there as well (as finfo_open() allows you to load a specific database), which result in the same messages (after I allowed access through open_basedir).
I also see Apache can use magic MIME, and has its own database in /usr/local/etc/apache22/magic. I tried loading that (again, open_basedir), and it -does- load the database, but the MIME types it returns aren't correct. (text/c++ for PHP files?)
I'm pretty sure the Apache and PHP magic MIME features aren't related, so I'm not planning on abusing the Apache magic file. I feel like I'm missing something obvious, but I don't know what. It shouldn't be this hard to get this working properly?
I upgraded Apache and PHP (and all dependencies, afaik).
Using the constant FILEINFO_MIME_TYPE results in notices that the constant is not defined. Which is odd on its own! However, using FILEINFO_MIME I get some useful warnings.
Now, it tells me:
Code:
Failed to load magic database at '/usr/share/misc/magic'.
I tried loading the other files there as well (as finfo_open() allows you to load a specific database), which result in the same messages (after I allowed access through open_basedir).
I also see Apache can use magic MIME, and has its own database in /usr/local/etc/apache22/magic. I tried loading that (again, open_basedir), and it -does- load the database, but the MIME types it returns aren't correct. (text/c++ for PHP files?)
I'm pretty sure the Apache and PHP magic MIME features aren't related, so I'm not planning on abusing the Apache magic file. I feel like I'm missing something obvious, but I don't know what. It shouldn't be this hard to get this working properly?