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.

need help AddHandler application/x-httpd-php .php .php4 .php3 .html

Discussion in 'General Discussion' started by rustikat, Oct 5, 2007.

  1. rustikat

    rustikat Member

    Joined:
    Mar 26, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    after new apache & php5 am unable to add to httpd/conf/httpd.conf

    AddHandler application/x-httpd-php .php .php4 .php3 .html
    AddType application/x-httpd-php .html

    This worked before upgrade - any help anyone?
     
  2. rachweb

    rachweb Well-Known Member

    Joined:
    Jun 26, 2004
    Messages:
    268
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    amsterdam
    Which apache version are you using? And is this the new easyapache 3.
     
  3. rustikat

    rustikat Member

    Joined:
    Mar 26, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    new easyapache 3

    Server Version: Apache/2.0.61 (Unix) mod_ssl/2.0.61 OpenSSL/0.9.8a FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1 PHP/5.2.4
     
  4. rachweb

    rachweb Well-Known Member

    Joined:
    Jun 26, 2004
    Messages:
    268
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    amsterdam
    The php configurations is in /usr/local/apache/conf/php.conf

    In that file must you edit/add changes.
     
  5. rustikat

    rustikat Member

    Joined:
    Mar 26, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    When I finally got to it all I had to do was add .html to

    SuPHP configuration for PHP5
    LoadModule suphp_module modules/mod_suphp.so
    suPHP_Engine on
    AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

    some where I saw something that needed to do after a manual edit was made to this file, something about distill? or something but can't find it now - any body know where it is located?
     
  6. rustelekom

    rustelekom Well-Known Member
    PartnerNOC

    Joined:
    Nov 13, 2003
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    moscow
    if you add .html then all .html files will execute a s php file. it is not your target. this file responsible for serverwide php configuration. Actually, if you standard Easipache 3 i don't seem correct way for customizing php settings. Suphp in default config do not allow you change suphpAddhandler directive. You need change suphp .c code manually and then recompile it or, just not use suphp for account where you need embed php in .html. For example, you cna compile for client php as cgi and then make all required change for this php binaries.

    PS. regard config file, i think you mention this path:

    /usr/local/apache/conf/userdata/std/2/username.conf

    you cam place here any customized virtual host setttings, but don't forgot have in main httpd.conf (inside virtual host directives)

    Include /usr/local/apache/conf/userdata/std/2/*.conf

    directive.
     
  7. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Can you advise how the customer can parse PHP in HTML files now with apache2 and suphp As the AddHandler option in htaccess no longer works ?

    I dont see a solution to the problem anywhere in this forum and we have a growing number of customers asking us for support on this.

    I've looked everywhere for a solution.

    Before, they could just add...

    AddHandler application/x-httpd-php .html

    ...in their .htaccess files and this would force their html files to be handled by PHP

    Is there something that needs adding to the apache2 configuration to enable the htaccess override?
     
  8. jdlightsey

    jdlightsey Perl Developer III
    Staff Member

    Joined:
    Mar 6, 2007
    Messages:
    126
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Houston Texas
    cPanel Access Level:
    Root Administrator
    It still works. You just need to use the correct MIME type. If you look in /usr/local/apache/conf/php.conf you'll see one or two "AddType" lines. They go like this..

    AddType <MIME Type> <File Extension> <File Extension> <...>

    The MIME type listed there is the one that you'd need to use in the .htaccess file..IE:

    AddHandler <MIME Type> <File Extension> <File Extension> <...>

    If you have a dual-php setup and you didn't set either version of PHP to run using mod_fcgid, your users will also have a setting in their cPanel interface to control which version of PHP is used by default for the .php file extension. It's in the x3 Theme under Software/Services->PHP Configuration. If they use that tool to select the default version of PHP for that account, it will create one of these AddHandler lines in their /home/<username>/.htaccess file. They could also add the file extension they want processed by PHP to the end of that AddHandler line.
     
  9. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    I can confirm that...

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

    ...is now working fine. Thanks for your help.
     
    #9 4u123, Nov 22, 2007
    Last edited: Nov 23, 2007
  10. pqhost

    pqhost Member

    Joined:
    Mar 17, 2004
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    whew! yes it is the solution
     
Loading...

Share This Page