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"
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?
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
(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).
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
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
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
The PHP entries were removed from /etc/mime.types, marking this as fixed. Best regards, CHTEKK.