The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MIMETypes/AddHandler Apache2, suPHP and PHP5

Discussion in 'EasyApache' started by WireNine, Oct 11, 2007.

  1. WireNine

    WireNine Well-Known Member

    Joined:
    Aug 14, 2006
    Messages:
    197
    Likes Received:
    0
    Trophy Points:
    16
    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:

    None of these work. HTML files with PHP are being prompt to download from the server instead of being parsed in firefox.
     
    #1 WireNine, Oct 11, 2007
    Last edited: Oct 11, 2007
  2. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Same problem!

    Any ideas?
     
  3. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Did you find a resolution to this ?
     
  4. LGRCompEnt

    LGRCompEnt Registered

    Joined:
    Apr 11, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Has there been a resolution with this thread? I have the same problem and I am still looking for a solution.

    Thanks
     
  5. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
    #5 nat, Jan 2, 2008
    Last edited: Jan 2, 2008
  6. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  7. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Yep

    AddHandler application/x-httpd-php5

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

Share This Page