Welcome to WebmasterWorld Guest from 18.208.186.19

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

About apache ReadmeName and HeaderName...

only for .htm?can't be .php?

     
4:49 pm on Dec 13, 2003 (gmt 0)

New User

10+ Year Member

joined:Dec 13, 2003
posts:9
votes: 0


i open my IE to visit my own web.Apache is running,after i edited the httpd.conf as following:
ReadmeName Foot.htm
HeaderName Head.htm
so, i see the result.

but when i use .php file instead of .htm file, it can't show.

does apache support Head.php as HeaderName?

10:23 pm on Dec 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


I suspect this is because the server does not know it has to parse the php file as php, instead of treating it as as plain text or html. In other words, the php interpreter is never invoked, so your code is not processed as code, just treated as text.

You could try embedding the php inside an html file, or perhaps use other directives (AddHandler embedded in a <Files> container?) to tell the server to parse the file as php. This is something I've never experimented with, though, so hopefully someone will come along with a more definitive answer.

Jim

3:57 am on Dec 14, 2003 (gmt 0)

New User

10+ Year Member

joined:Dec 13, 2003
posts:9
votes: 0


thank you, jdMorgan.
but normal .php files in my web are working well.
only when they're changed to be ReadmeName file and HeaderName file, it doesn't work.
Apache ignores them as if it has no ReadmeName file...
4:09 am on Dec 14, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Yes, I suspect that's because the header/footer files are processed in a completely different software 'path' than regular page requests, and Apache may not have all the support for non-html pages and scripting available for what was originally intended for simple custom directory headers and footers.

Again, I've never used anything but simple headers and footers, so this is beyond my experience. Maybe someone else can help you. If not, you might want to ask over in the PHP forum, too.

Jim

4:13 am on Dec 14, 2003 (gmt 0)

New User

10+ Year Member

joined:Dec 13, 2003
posts:9
votes: 0


Oh...i get the point.
"Both HeaderName and ReadmeName now treat Filename as a URL path relative to the one used to access the directory being indexed. Filename must resolve to a document with a major content type of "text/*"(e.g.,text/html,text/plain,etc.)..."

and then i found .php is application.
AddType application/x-httpd-php .php

5:00 am on Dec 14, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Yes, although as I said above, it might be worth testing to see if you can invoke php from inside an html page -- to use an html page as a "plain-text wrapper" for a php call, in other words.

Maybe it will work, and maybe not. It might be a good experiment to try anyway.

Jim