HowTo: “mod_mime_magic: invalid type 0 in mconvert()” error

If you’re getting the “mod_mime_magic: invalid type 0 in mconvert()” error in your error log of Apache (or any other http server), it’s most probably due to fault in mime-magic’s configuration.

Simply open the /usr/share/file/magic.mime file in your text editor, and comment out the faulty lines (put ‘#‘ sign at the beginning of line).
Those are typically the following:

0    search/400    \\input        text/x-tex
0    search/400    \\section    text/x-tex
0    search/400    \\setlength    text/x-tex
0    search/400    \\documentstyle    text/x-tex
0    search/400    \\chapter    text/x-tex
0    search/400    \\documentclass    text/x-tex

– in the “TeX documents” section, around line 630, and often also

0    regex        [Cc]onstant[[:space:]]+[Ss]tory    text/x-inform

– in “Type: Inform interactive fiction language“, right after the previous one, and

0    regex        BEGIN[[:space:]]*[{]    application/x-awk

– around line 300 (sometimes already commented out).

To check which lines exactly to comment out, check the mod_mime_magic errors printed right after the Apache start.

4 responses to “HowTo: “mod_mime_magic: invalid type 0 in mconvert()” error

  1. Thanks a lot for posting this. I had a good idea about what was wrong but I was too much focused on the “invalid type 0” error and always missed the errors which Apache provided when starting. After reading your post to the end (lucky me;) I could resolve it all. Thanks.

  2. Hi
    I also get this error in apache log but not print at all when apache start so I am kinda confuse about the lines I should comment out

    thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s