 |
 |
 |
 |
January 26th, 2004, 05:17 PM
|
#1
|
|
Big Daddy
Join Date: Jan 2004
Location: Boston, MA
Posts: 380
|
Configure Apache to allow php code IN html.
Hi guys,
I know a reasonable amount about Apache, but am no expert. Have a question for you. My Apache server is running on linux. All of my pages on my site are .html extensions (except for a few .php pages. Recently, I started learning php. One thing I tried was to put php code INTO html. When I did this and tried to view the site, the php code would actually show up ON the site in the browser. I have been told that:
Quote:
"PHP has to be in pages that end with the .php extension, unless your server is set up to run .html pages through the parser. Most shared hosting is set up to only process php scripting in .php, .php3 and .php4 pages."
|
I'll look into it, but what exactly does that mean, and what do I have to do in httpd.conf to allow php code to run in html? Thanks!
Chris
__________________
My Site | My Blog
"The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
"Insanity is doing the same thing over and over again, expecting different results"
--Albert Einstein
|
|
|
January 27th, 2004, 06:42 PM
|
#2
|
|
Registered User
Join Date: Jan 2004
Location: 92677
Posts: 26
|
In your httpd.conf (assumming that you currently have php working), you should see a line such as "AddType application/x-httpd-php .php .phtml". Change this to "AddType application/x-httpd-php .php .phtml .html" and so on for other extentions you want to allow php in.
|
|
|
January 27th, 2004, 09:29 PM
|
#3
|
|
Big Daddy
Join Date: Jan 2004
Location: Boston, MA
Posts: 380
|
Hey Matt. Thanks! I actually found an answer at DS. Got it working today.
Chris
__________________
My Site | My Blog
"The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
"Insanity is doing the same thing over and over again, expecting different results"
--Albert Einstein
|
|
|
February 1st, 2004, 12:45 PM
|
#4
|
|
Registered User
Join Date: Jan 2004
Location: Philadelphia
Posts: 42
|
I've already got my apache parsing .shtml files for SSI includes, will it also parse them for php automatically, or do i need to specify php includes also?
|
|
|
February 1st, 2004, 06:09 PM
|
#5
|
|
Registered User
Join Date: Jan 2004
Location: 92677
Posts: 26
|
To be on the safe side, add .shtml to the list as shown above.
|
|
|
February 20th, 2004, 12:10 PM
|
#6
|
|
Registered User
Join Date: Feb 2004
Posts: 33
|
Quote:
Originally posted by whiteknight
I've already got my apache parsing .shtml files for SSI includes, will it also parse them for php automatically, or do i need to specify php includes also?
|
You will need to add the extension to the handler.
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:46 AM.
|
|
 |
 |
 |
 |
|