Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116475 - AddType... php is no longer effective
Summary: AddType... php is no longer effective
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on: 116516
Blocks:
  Show dependency tree
 
Reported: 2005-12-23 03:45 UTC by Jason Carlson
Modified: 2006-01-04 03:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Carlson 2005-12-23 03:45:24 UTC
I enable php on a virtual host basis so I remove the related AddType lines from the modules.d/70_mod_php.conf file and then I only put them in the <VirtualHost ..> areas.

I performed an emerge update and it updated dev-lang/php5 to 5.0.5-r4 and apache2.x to 2.0.55 and I now notice that PHP is enabled (parsed) for all sites.  I've done extensive searching and can remove every single instance of "AddType application/x-httpd-php" from my system and a virtual host will still parse .php pages.

I did an emerge about a month ago when things shifted from dev-php/php5 to dev-lang/php5.  This issue could of started at this point as I don't think I've had any requests to add php to clients sites since then, but I did have sites requesting this one month ago (and I'm sure I did that emerge after those requests came in).  So that is as close as I can narrow it down to at this point.

I have compile apache with
"+apache2 -debug -doc -ldap -mpm-leader -mpm-peruser +mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads"
Comment 1 Jason Carlson 2005-12-23 04:13:52 UTC
Okay, found reason it is happening, but not sure what to do.

The httpd.conf file has the line:
TypesConfig /etc/mime.types
And that /etc/mime.types file has "application/x-httpd-php" lines assigning extensions such as .php and .php4 to them.

I commented out the related php lines in the /etc/mime.types and it works just fine now.  But will this break cli?  Maybe I should be removing that line from httpd.conf instead - Should apache be linking to that file in the first place?

Thoughts?
Comment 2 Stuart Herbert (RETIRED) gentoo-dev 2005-12-23 05:11:27 UTC
Hi,

You've found a real problem here.

Apache *should* be using that file, instead of the one that ships with Apache.  It's a deliberate decision to reduce duplication.  But, as you've pointed out, /etc/mime.types has too many entries in it for it to be 100% compatible with the Apache config files.

I don't recommend removing entries from /etc/mime.types.  Depending on what other software you install, things could break in annoying ways.

The easiest solution is for us to add a RemoveType for php (and for anything else that can be installed via an Apache module) to the default Apache config files.

Best regards,
Stu
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-12-23 05:26:33 UTC
(In reply to comment #2)
> The easiest solution is for us to add a RemoveType for php (and for anything
> else that can be installed via an Apache module) to the default Apache config
> files.

Stuart, can you verify that RemoveType works for you? Someone reported that it's broken in recent apache versions (Bug 112247).
Comment 4 Paul Querna 2005-12-23 07:46:49 UTC
This is the wrong solution.

You should use AddHandler for php, instead of screwing with the MIME TYpes. PHP is a HANDLER, not a file format.

-Paul
Comment 5 Stuart Herbert (RETIRED) gentoo-dev 2005-12-23 10:41:35 UTC
Hi Paul,

Sorry, mod_php only requires AddType to activate, not AddHandler.  AddHandler's only needed for setting up php-cgi.

http://www.php.net/manual/en/install.unix.apache2.php

Best regards,
Stu
Comment 6 Stuart Herbert (RETIRED) gentoo-dev 2005-12-23 11:06:18 UTC
After a discussion in #gentoo-apache, we've decided to get the PHP entries removed from /etc/mime.types.  I've filed a bug with the net-mail herd (who own this package) to get it fixed.

For now, just remove the entries by hand from your local copy.

Best regards,
Stu
Comment 7 Luca Longinotti (RETIRED) gentoo-dev 2006-01-04 03:06:06 UTC
The PHP entries were removed from /etc/mime.types, marking this as fixed.
Best regards, CHTEKK.