WebmasterLingo
JustEdge Dedicated Servers

Go Back   WebmasterLingo > Hosting Corner
User Name
Password

 
Thread Tools Search this Thread Rate Thread Display Modes
Old January 26th, 2004, 05:17 PM   #1
WorldBuilder
Big Daddy
 
Join Date: Jan 2004
Location: Boston, MA
Posts: 380
WorldBuilder is off the scale
Send a message via AIM to WorldBuilder
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
WorldBuilder is offline   Reply With Quote
Old January 27th, 2004, 06:42 PM   #2
mttatkns
Registered User
 
Join Date: Jan 2004
Location: 92677
Posts: 26
mttatkns is off the scale
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.
mttatkns is offline   Reply With Quote
Old January 27th, 2004, 09:29 PM   #3
WorldBuilder
Big Daddy
 
Join Date: Jan 2004
Location: Boston, MA
Posts: 380
WorldBuilder is off the scale
Send a message via AIM to WorldBuilder
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
WorldBuilder is offline   Reply With Quote
Old February 1st, 2004, 12:45 PM   #4
whiteknight
Registered User
 
Join Date: Jan 2004
Location: Philadelphia
Posts: 42
whiteknight is off the scale
Send a message via AIM to 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?
whiteknight is offline   Reply With Quote
Old February 1st, 2004, 06:09 PM   #5
mttatkns
Registered User
 
Join Date: Jan 2004
Location: 92677
Posts: 26
mttatkns is off the scale
To be on the safe side, add .shtml to the list as shown above.
mttatkns is offline   Reply With Quote
Old February 20th, 2004, 12:10 PM   #6
Matrix28
Registered User
 
Join Date: Feb 2004
Posts: 33
Matrix28 is off the scale
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.
Matrix28 is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 05:46 AM.

Windows 2003, cPanel & DirectAdmin Unix Web Hosting