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?
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?
Which apache version are you using? And is this the new easyapache 3.
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
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?
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.
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?
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.
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.
whew! yes it is the solution