logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: php module / parse html as php with htaccess prompts to down
Author
ranger



Joined: 01 Nov 2011
Posts: 11

PostPosted: Tue 22 Sep '15 15:32    Post subject: php module / parse html as php with htaccess prompts to down Reply with quote

I have a html site and I want html pages to be parsed as php; I'm using a htacces file for that.

On the online server, when the site is online, it works properly. The command is:
AddHandler application/x-httpd-php5 .html .htm

However, on ly localhost server it doesn't work at all. When I access the page, it prompts to download the file instead of displaying the page.
I'm using PHP 5.6.3 and PHP as module, I guess.

I tried all sorts of similar commands in htaccess, like:
AddType application/x-httpd-php .html .htm
AddType application/x-httpd-php5 .html .htm
AddHandler application/x-httpd-php .html .htm
AddHandler application/x-httpd-php5 .html .htm
AddHandler application/x-httpd-php .html .htm
AddHandler application/x-httpd-php5 .html .htm
AddHandler x-mapp-php .html .htm
AddHandler x-mapp-php5 .html .htm

but no luck.

I also tried RemoveHandler .html .htm
but without success.


I checked the httpd.conf file and among others, there are the following:

LoadModule php5_module "C:/Program Files/PHP/php5apache2_4.dll"

AllowOverride All

<Directory "D:/mysites/">
AllowOverride All
Require all granted
</Directory>


Where should I look for anything wrong then..?
Any hint appreciated
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 07 Oct '15 13:56    Post subject: Reply with quote

the correct thing would be

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


what sould be in the vhost config.

if you use .htaccess make sure that AllowOverride is set to All
Back to top


Reply to topic   Topic: php module / parse html as php with htaccess prompts to down View previous topic :: View next topic
Post new topic   Forum Index -> Other Software