|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36772 Apache installation docs erronously suggest AddType rather than AddHandler
Submitted: 2006-03-17 15:26 UTC Modified: 2006-03-20 16:17 UTC
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:4 (66.7%)
From: noodlet at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-03-17 15:26 UTC] noodlet at gmail dot com


AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

as part of step 15. While this _works_, it's an old and grotty hack. The correct directive to use is AddModule.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-17 15:33 UTC]
What are you talking about, AddModule just loads the libphp[45].so apache module?

 [2006-03-17 16:54 UTC] noodlet at gmail dot com

I meant AddHandler, not AddModule.

AddHandler application/x-httpd-php .php .phtml
AddHandler application/x-httpd-php-source .phps

(Must remember to think before typing)
 [2006-03-17 18:50 UTC]
Ok, if AddHandler is definitely the term to have in the manual for Apache1/2, then here is the patch :

Thanks in advance.

 [2006-03-18 02:21 UTC]
Rasmus comments about this ( ):

"There was a time when there was no AddHandler directive.  Addtype was the way you did this.  Since AddType works with every version of Apache I never saw a 
reason to change this even after AddHandler was added since it is purely academic in nature."

 [2006-03-20 15:57 UTC] noodlet at gmail dot com
Thanks for the patch. It looks like the faq contains AddType as well, so I'll update your patch when I figure out how to grab the docs source :)

"Rasmus said something and must be right" isn't terribly convincing.

AddType tells the browser what to do with a file. AddHandler tells the server what to do with a file.

While it's true that AddHandler didn't exist 8 years ago, it does now. This is confusing for people learning about apache. I personally remember wondering why AddType was used for both mime types and dynamic content.

It has been pointed out to me elsewhere that AddType interferes with mod_security's auditting. So clearly, this isn't "just academic".

 [2006-03-20 16:17 UTC] noodlet at gmail dot com
I've been asked to post this on behalf of somebody else who can't, given this ticket's current status.

=== lamp (lampiluoto at gmail dot com) says:
Even though AddType "works" in basic setup, there are 3rd party modules that rely on proper use of handlers. One example of AddType *not* working is mod_security and audit logging.

If one uses mod_security and audit logging with 'SecAuditEngineDynamicOrRelevant' to log requests on dynamic or relevant content then using AddType doesn't work. Mod_security considers content dynamic if handler is not null and therefore use of AddHandler is necessary. If 
AddType is used as PHP's documentation advices, dynamic content produced with PHP won't be logged.

Reference to mod_security audit log documentation:

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 09:01:28 2024 UTC