MIMETypes/AddHandler Apache2, suPHP and PHP5

WireNine

Well-Known Member
Aug 14, 2006
207
4
168
cPanel Access Level
Root Administrator
Parsing PHP in .html Files with Apache2/suPHP PHP5? The old method does not work :confused:

Adding AddHandler in .htaccess file is not working.

Have tried each one of these without any success:

AddType application/x-httpd-php .php .htm .html

AddType x-httpd-php .php .htm .html

AddType application/x-httpd-php5 .php .htm .html

AddType x-httpd-php5 .php .htm .html

AddHandler application/x-httpd-php5 .php .htm .html

AddHandler x-httpd-php5 .php .htm .html

AddHandler application/x-httpd-php .php .htm .html

AddHandler x-httpd-php .php .htm .html
None of these work. HTML files with PHP are being prompt to download from the server instead of being parsed in firefox.
 
Last edited:

LGRCompEnt

Registered
Apr 11, 2005
4
0
151
Has there been a resolution with this thread? I have the same problem and I am still looking for a solution.

Thanks
 

nat

Well-Known Member
Jan 16, 2003
209
0
166
I'm having the same problem on my servers.

I cannot use the following in a .htaccess file to get php to work with .html extensions.

AddHandler application/x-httpd-php .html


I'm running apache v1.x with phpsuexec. PHP version 5.2.5

It started when I used the new easyapache to compile PHP.

I also noticed httpd.conf no longer has all of the php stuff like...

AddHandler application/x-httpd-php .php .php4 .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .phtml

I added it and it then php wouldn't work at all so I took it back out.
 
Last edited:

nat

Well-Known Member
Jan 16, 2003
209
0
166
Using these will now cause a download prompt when accessing a php script. If you have any of these in httpd.conf take it out.

AddHandler application/x-httpd-php .php .php4 .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .phtml


/usr/local/apache/conf/php.conf is used now.


I used what /usr/local/apache/conf/php.conf uses in a .htaccess file and it worked.

AddHandler application/x-httpd-php5 .html .htm .php
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
948
29
178
Yep

AddHandler application/x-httpd-php5

is what you need. I've seen it in another thread also