\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
Although this is not how to related to horde, I am posting this here as fileinfo is quite useful and I couldnt get it working for quite some time.

\begin{itemize}
\item Read the <a href="http://www.horde.org/horde/docs/?f=INSTALL.html">/horde/doc/INSTALL</a>


\item \texttt{pear install fileinfo-beta} will not work on RHEL without the following package.


\item Get the latest file package from <a href="ftp://ftp.gw.com/mirrors/pub/unix/file/">ftp://ftp.gw.com/mirrors/pub/unix/file/</a>


\item Install it with \texttt{./configure --prefix=/usr \&\& make \&\& make install}


\item then \texttt{pear install fileinfo-beta} note: it is now changed to \texttt{pecl install fileinfo-beta}


\item Add the following in \texttt{php.ini}


\end{itemize}
<pre><code>
;Magic mime time
mime\_magic.magicfile = "/usr/share/file/magic.mime"

extension=fileinfo.so

;;;;
; Note: For Red Hat Linux, packaged extension modules are now loaded via
; the ini files in the directory /etc/php.d.
;;;;
</code></pre>
so also add in \texttt{/etc/php.d/fileinfo.ini}

<pre><code>
extension=fileinfo.so
</code></pre>
\begin{itemize}
\item restart apache and check \texttt{/horde/test.php}. At this point I got MIME Magic Support: Yes


\end{itemize}
I get the following errors in \texttt{/var/log/httpd/error\_log}, not sure how to get rid of them and if it hampers the fileinfo functioning.

<pre><code>
PHP Warning:  Function registration failed - duplicate name - finfo\_open in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - finfo\_close in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - finfo\_set\_flags in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - finfo\_file in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - finfo\_buffer in Unknown on line 0
PHP Warning:  fileinfo:  Unable to register functions, unable to load in Unknown on line 0
[Sat May 21 00:57:42 2005] [notice] Apache/2.0.46 (Red Hat) configured -- resuming normal operations
</code></pre>
Request for anyone who has done the above in a proper way, do share and modify what needs to be done right.

Jigish.gohil at gmail dot com

\section{Note: If you're getting \textit{\textbf{Function registration failed - duplicate name}} errors, you probably have the module registered twice as an extension.<br />
As an example, modules are loaded (on ``<a href="https://wiki.horde.org/FreeBSD">FreeBSD</a>``) from /usr/local/etc/php/extensions.ini.  If you had an entry for fileinfo.so inside extensions.ini,<br />
and then you added another "extension=fileinfo.so" in php.ini - it would try to load twice (once from extensions.ini and once from php.ini), causing<br />
the above errors.  I realize the location and names of files may be different on a Red Hat system, and I use ``<a href="https://wiki.horde.org/FreeBSD">FreeBSD</a>`` - but the explanation is<br />
still valid.}
For Fedora Core 4, do the following:

\begin{itemize}
\item \texttt{yum install php-devel}


\item \texttt{pear install fileinfo}


\item Add the following in \texttt{php.ini}


\end{itemize}
<pre><code>
;Magic mime time
mime\_magic.magicfile = "/usr/share/file/magic.mime"

extension=fileinfo.so

;;;;
; Note: For Red Hat Linux, packaged extension modules are now loaded via
; the ini files in the directory /etc/php.d.
;;;;
</code></pre>
so also add in \texttt{/etc/php.d/fileinfo.ini}

<pre><code>
extension=fileinfo.so
</code></pre>
\begin{itemize}
\item restart apache and check \texttt{/horde/test.php}. At this point I got MIME Magic Support: Yes


\end{itemize}
tom at kofler dot eu dot org

\textbf{NOTE: Most Unix-like systems doesn't correctly handle Microsoft Word and Microsoft Excel MIME types. If you very heavy rely on these types, use integrated Horde MIME magic library instead. See <a href="http://bugs.horde.org/ticket/?id=3565">bug \#3565</a> for more info.}

\end{document}
