Propeller head alert: Most of you won’t be interested in this, but I had to get the mime_magic module working with Apache/PHP on Mac OS X 10.4 this morning, and thought I’d write up the steps.
The following steps require the XCode developer tools to be installed on your system (these are included on the Mac OS X install CDs). The steps also assume that PHP4.4.1 is installed (the default for 10.4.4+).
- Uncomment the following lines in /etc/httpd/httpd.conf
LoadModule mime_magic_module libexec/httpd/mod_mime_magic.so
- Update the following section to reflect your system setup
- Download the matching version of PHP for your system.
- Extract archive and go to the “/ext/mime_magic” in the extracted directory.
- Open terminal and run:
- Note down the installed directory
- Update extension_dir value to match installed directory – e.g.:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20020429/"
- Add a section to PHP.ini containing:
mime_magic.magicfile = "/etc/httpd/magic"
where “/etc/httpd/magic” matches your system setup
- Restart apache (using Sharing system preference pane)
Thanks to Andrew at RWTS for walking me through most of the above to get it running…
Update: Unfortunately this breaks when using PHP from the command line. Keeps complaining about:
Symbol not found: _OnUpdateString
Any thoughts much appreciated…
Update 01-Sep-2006: With some more help from Andrew I recompiled PHP (with mime_magic as a compile option) and the problem is resolved. Had issues with PEAR, but was able to resolve them using the PEAR bits of this tutorial (I had to run
curl http://go-pear.org | sudo php).
It all seems to be working, but we’ll wait and see if anything else comes up…