Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Mar 2005
    Posts
    10

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

    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. #2
    Member
    Join Date
    Jun 2004
    Location
    amsterdam
    Posts
    267

    Default

    Which apache version are you using? And is this the new easyapache 3.

  3. #3
    Member
    Join Date
    Mar 2005
    Posts
    10

    Default

    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. #4
    Member
    Join Date
    Jun 2004
    Location
    amsterdam
    Posts
    267

    Default

    Quote Originally Posted by rustikat View Post
    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
    The php configurations is in /usr/local/apache/conf/php.conf

    In that file must you edit/add changes.

  5. #5
    Member
    Join Date
    Mar 2005
    Posts
    10

    Default

    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. #6
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Nov 2003
    Location
    moscow
    Posts
    294

    Default

    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.
    https://robobill.net
    US dedicated, Europe and Asia and Russia dedicated server. Shared, Reseller, VPS hosting in US and Europe.
    We are RESELLER of dedicated servers since 2002.

  7. #7
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jan 2006
    Posts
    654

    Default

    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. #8
    cPanel Staff
    Join Date
    Mar 2007
    Posts
    113

    Default

    Quote Originally Posted by 4u123 View Post
    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 ?
    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. #9
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jan 2006
    Posts
    654

    Default

    I can confirm that...

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

    ...is now working fine. Thanks for your help.
    Last edited by 4u123; 11-23-2007 at 04:07 AM.

  10. #10
    Registered User
    Join Date
    Mar 2004
    Posts
    24

    Default

    whew! yes it is the solution

Similar Threads & Tags
Similar threads

  1. Configure PHP and SuExec PHP5/4 addhandler issue
    By devGOD in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-10-2011, 02:47 PM
  2. application/x-httpd-php download
    By vlkn448 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-18-2009, 01:27 PM
  3. FireFox and PHP "application/x-httpd-php" Error
    By RuneOwn in forum New User Questions
    Replies: 21
    Last Post: 08-11-2007, 07:16 AM
  4. Replies: 5
    Last Post: 01-05-2007, 12:41 PM
  5. PHP 5 and x-application-httpd issues
    By escalf in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-09-2006, 11:20 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube