/    Sign up×
Community /Pin to ProfileBookmark

Apache help with PHP & html

First of all, Thanks for any help in advance!!!
Here is my problem. I am running Apache 2 on an XP Home machine. I if I write a script and name it with the .php extension it works fine. However when I include the <? ?> tags in an .html file the server does not parse the file for PHP scripting and that section of the page is left blank. It that just the way it is or can I set something in the confif files to make the server parse .html files for PHP scripting?

Tahnks for all the help
Rahn

to post a comment
Full-stack Developer

3 Comments(s)

Copy linkTweet thisAlerts:
@StefanJan 29.2003 — Either rename your .html to .php or change the config so that it parses also .html files.

Read the documentation for how to do that if that is the choise you take.
Copy linkTweet thisAlerts:
@swonJan 31.2003 — A document with php-tags would always need an .php ending, if you can make it to work with parsing .html files in the php.ini or the httpdconfig file in apache, the server loose much of performance.
Copy linkTweet thisAlerts:
@StefanJan 31.2003 — [i]Originally posted by swon [/i]

[B]A document with php-tags would always need an .php ending, if you can make it to work with parsing .html files in the php.ini or the httpdconfig file in apache, the server loose much of performance. [/B][/QUOTE]


That doen't sound logical at all. If all your .html pages contains PHP (quite likely if you are using PHP templates) then if they are called .html or .php doesn't matter at all.

Only if you have a large portion of webpages WITHOUT any PHP in them would it add unnessecary overhead to parse all .html files through the PHP engine.
×

Success!

Help @lomfs24 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...