|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #28023 Apache2: PHP installation method breaks content negotiation
Submitted: 2004-04-16 06:25 UTC Modified: 2004-09-19 12:09 UTC
From: mark at tranchant dot plus dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.5 / 5.0.1 OS: Linux
Private report: No CVE-ID: None
 [2004-04-16 06:25 UTC] mark at tranchant dot plus dot com
Please see which describes the problem. Basically, the installation instructions break Apache's MultiViews. The URL above also presents a solution, which relies on largely undocumented features. I'd like these features documented to prevent them disappearing in future versions.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-18 11:01 UTC]
This is in the Apache 2 documentation: "The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*". So the only problem is if the request doesn't contain .php extension, right?
 [2004-09-18 21:10 UTC] mark at tranchant dot plus dot com
Yes. The whole point of content negotiation is that the URLs do not force the file type, but the Accept request header gives the server the information it needs to choose an appropriate file type.

It also allows the author to switch technologies (e.g. static .html to dynamic .php) without updating all the links and suffering from out-of-date inbound links.

You're right - the problem only occurs if the request doesn't contain .php, but that's not a workaround. The solution presented on my page is a workaround, but it's not documented. Basically, the server admin needs to use:

AddHandler php5-script php
AddType text/html php

instead of

AddType application/x-httpd-php .php

Then, when an extensionless request comes in with an Accept header including text/html, the server knows that the .php file is an appropriate type to send.
 [2004-09-19 12:09 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

I added an FAQ for this. Thanks for good description.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 21:01:27 2024 UTC