|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7867 parsing *.html through PHP breaks Apache mod_autoindex
Submitted: 2000-11-17 15:33 UTC Modified: 2000-12-13 06:10 UTC
From: boerm at u dot washington dot edu Assigned:
Status: Closed Package: Apache related
PHP Version: 4.0.3pl1 OS: Tru64 4.0D (OSF1 V4.0 878 alpha)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: boerm at u dot washington dot edu
New email:
PHP Version: OS:


 [2000-11-17 15:33 UTC] boerm at u dot washington dot edu
With PHP4 compiled as an Apache module, configuring Apache to parse all .html files breaks the Apache mod_autoindex.  For example, having this line:

AddType application/x-httpd-php .phtml .php3 .php4 .php .html .htm

in my Apache configuration will break FancyIndexing.

With the above as a system-wide setting, one can add the following:

AddType text/html .html
AddHandler server-parsed .html

on a directory-by-directory basis.  This restores FancyIndexing, but breaks any PHP coding that is embedded in .html files in those directories.

Here's my current PHP config line:

./configure --with-mysql=/usr/local/mysql --with-apache=/usr/local/work/apache_1.3.14 --enable-memory-limit=yes --enable-debug=no

What I'd like is to be able to have both FancyIndexing and PHP-parsed .html files.  Any suggestions?

This bug was previously reported into the Apache-BugDB as internal identification `mod_autoindex/6190'.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-11 05:36 UTC]
What do you mean by "breaks FancyIndexing"? What exactly
 [2000-12-13 05:54 UTC]
User reply:
Thanks for investigating!

"breaks FancyIndexing" == PHP4 stops, cancels, aborts, or
prevents Apache
FancyIndexing from working as it should.

When FancyIndexing is working, <title> strings are parsed
for use as file
descriptors.  Also, HEADER.html and README.html documents
are (optionally)
inserted into the index results.  PHP4 seems to break all of
FancyIndexing features.

One FancyIndexing feature that *does* still work is the
feature that permits
lines to be entered in .htaccess to provide descriptions for
each file (which
would override the <title> string parsing mentioned above).

And example of a directory with broken FancyIndexing:
I'm not sure when FancyIndexing first broke.  I do know it
was working with
PHP2, and I believe it was working in (at least early)
versions of PHP3.I'd be happy to provide further
descriptions or perform other diagnostics if
it would help.

[X] Michael Boer

 [2000-12-13 06:10 UTC]
TITLE to description (ScanHTMLTitles) work only on HTML
(text/html) files. PHP files have type
application/x-httpd-php, so Apache won't look into them for
description. This is what Apache manual says about header
and footer:

Apache versions after 1.3.6: Filename is treated as a URI
path relative to the one used to access the directory being
indexed, and must resolve to a document with a major content
type of "text" (e.g., text/html, text/plain, etc.). This
means that filename may refer to a CGI script if the
script's actual file type (as opposed to its output) is
marked as text/html such as with a directive like:

AddType text/html .cgi

So I guess it's a configuration/Apache problem.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 23:05:51 2022 UTC