Re: [SLUG] Apache on Debian won't run php

From: John Pedersen (john@jmp-systems.com)
Date: Thu Aug 07 2003 - 10:44:54 EDT


Michael Manchester wrote:
> I've searched google and tried a number of things such
> as adding lines to the httpd.conf
> <IfModule mod_php4.c>
> AddType application/x-httpd-php .php4 .php3 .phtml
> .php
> AddType application/x-httpd-php-source .phps
> </IfModule>
> restared apache and I'm still getting the following
> when I try to run a simple php script to check the php
> settings.
> The browser is returning:
> The file "phpinfo.php" is of type
> application/x-httpd-php, and mozilla firebird does not
> know how to handle this file type.
>
> And mozilla prompts me to download or open it. Also IE
> want's to download the file.
>
> I'm at a lose here. I had apache working with php on
> redhat 7.1 but can't seem to get it to work Debian.
> I am seeing the following in the error.log when I
> start apache
> [Thu Aug 7 10:04:35 2003] [error] (2)No such file or
> directory: mod_mime_magic:
> can't read magic file /etc/apache/share/magic
> I've tried to create a link to
> /usr/share/misc/magic
> but when apache is restarted it spits out a number of
> error messages about invaild lines.
>
> Thanks for any help with this
> Mike M.

Your server isn't realizing that when you request a php file, it
should hand it over to the php engine to parse the file. As a result,
it just tries to send you the file you requested.

I believe there are two ways that the server can figure out that it's
a php file, and needs parsing. A) from the extension, php, php3,
phtml, etc. or B) using the magic file, which tries to decide by
looking at the actual file content.

My inclination would be to turn off the magic file, and let the
extension be sufficient.

Here's a link to info about magic:

http://www.phpfreaks.com/apache_manual/page/mod/mod_mime_magic.html

Maybe this is all old news to you.

John

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:14:20 EDT