|
Home > Archive > Web Servers on Unix and Linux > April 2005 > SetHandler won't work in '.htaccess'
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
SetHandler won't work in '.htaccess'
|
|
| francescomoi@europe.com 2005-04-22, 5:54 pm |
| Hi.
Working with Apache 2 on Linux, I'm trying to make 'whatever.foo' be
executed
as a php file within my 'http://homeserver' (/home/user/html)
So I inserted a .htacess within '/home/user/html':
--------------
SetHandler application/x-httpd-php
--------------
And I created 'test' file:
-------------------
<?php
print "Hello World!\n";
?>
------------------
But when accessing 'http://homeserver/test' I can only see the PHP
code,
but not "Hello World". What am I doing wrong?
Thxs
| |
| Andy Davidson 2005-04-24, 7:46 am |
| [francescomoi@europe.com wrote in comp.infosystems.www.servers.unix]
> Working with Apache 2 on Linux, I'm trying to make 'whatever.foo' be
> executed
> as a php file within my 'http://homeserver' (/home/user/html)
> So I inserted a .htacess within '/home/user/html':
> SetHandler application/x-httpd-php
> And I created 'test' file:
><?php
> print "Hello World!\n";
> ?>
> But when accessing 'http://homeserver/test' I can only see the PHP
> code, 2but not "Hello World". What am I doing wrong?
Is Apache's php support compiled as a module ? If so, do you have
a line along the lines of :
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
in your httpd.conf ?
You'd also need to use :
ForceType application/x-httpd-php
in your .htaccess instead of SetHandler.
--
http://fotoserve.com/ - Prints, Slides, Posters, Mugs, T-shirts,,
Calendars, Jigsaws, Tableware, Caricatures, Greetings cards, Picture
bags, Photo Album and Book covers, Canvas Prints, tissues and more
..... from your own digital images.
| |
| francescomoi@europe.com 2005-04-25, 2:51 am |
| Andy Davidson wrote:
> [francescomoi@europe.com wrote in comp.infosystems.www.servers.unix]
be[vbcol=seagreen]
>
> Is Apache's php support compiled as a module ? If so, do you have
> a line along the lines of :
>
> LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
>
> in your httpd.conf ?
Yes. It's a PHP-compiled Apache server and I've got the line you
mentioned.
>
> You'd also need to use :
>
> ForceType application/x-httpd-php
>
> in your .htaccess instead of SetHandler.
I did it, but it doesn't work. 
|
|
|
|
|