Forum Moderators: coopster

Message Too Old, No Replies

How do you get html to parse as php

I heard this could be figured?

         

Clark

6:38 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd like to configure one domain to parse an .html file as php. Is this possible? I have root access on the server.

jatar_k

7:05 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you may have this line in your httpd.conf

AddType application/x-httpd-php .php

you can add .html to the end

AddType application/x-httpd-php .php .html

wsmeyer

7:14 am on Dec 1, 2005 (gmt 0)

10+ Year Member



In your .htaccess file look for a line that looks like this...

AddType application/x-httpd-php .php

and add .htm and .html to the list like this...

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

It actually doesn't matter where you put them in your .htaccess file but it's a good idea to keep things organized :)

What this will do is pass all your .htm and .html pages through the PHP parser just like .php files.

The downside is extra server load so if it is just a couple html files you need this for you might want to look into using mod-rewrite instead.

William.

Clark

7:27 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks fellas.

Unfortunately saw something scary because unknown while trying to modify this. Permissions are

"---x-wx--T 1 root root 57291 Nov 8 20:06 httpd.conf*"

Now what the hell is T?

jatar_k

7:32 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



got me, no clue, those are questions I ask other people ;)

Clark

7:35 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dam. Hate when I don't know something like a permission. Makes you feel like you've been hacked.

wsmeyer

7:38 am on Dec 1, 2005 (gmt 0)

10+ Year Member



"---x-wx--T 1 root root 57291 Nov 8 20:06 httpd.conf*"

I've actually seen that before (translation >> I've made the same mistake)

When you are setting the permissions if you forget a leading zero you'll get that T

As an example:

600 looks like --x-wx--T
0600 correctly returns --x-wx---

William.

Clark

7:42 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I didn't set the permission though. Cpanel did. So is that OK? Do I need to change anything?

wsmeyer

8:07 am on Dec 1, 2005 (gmt 0)

10+ Year Member



The more I look at it the stranger it looks. Permissions are made up of 9 variables, each can be either...

r = read
w = write
x = execute

the string is broken up into groups of three...

user - group - world

The most common setting for a .htaccess file is...

rw-r--r--

Which gives read/write permission to the owner and just read permission to everyone else.

Yours somehow has ans x in it. Since there is nothing to execute in the file this isn't going to allow anything to happen but I'm not sure why it is like that.

William.

Clark

8:27 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well the X is execute as you said...that I'm familiar with, but T? Never heard of it.

Clark

4:07 pm on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone else have some insight?

coopster

4:15 pm on Dec 1, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The man pages (man ls) tell us that ...


These next two apply only to the third character in the last group (other permissions). 
T The sticky bit is set (mode 1000), but not execute
or search permission. (See chmod(1) or sticky(8).)
t The sticky bit is set (mode 1000), and is search-
able or executable. (See chmod(1) or sticky(8).)

Clark

4:32 pm on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



THANK YOU!
I didn't know what command to MAN.

Sticky bit huh? Can anyone translate the meaning (although it's a relief to know that the permission exsists).