SetHandler won't work in '.htaccess'

This is a discussion on SetHandler won't work in '.htaccess' within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi. Working with Apache 2 on Linux, I'm trying to make 'whatever.foo' be executed as a PHP file ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-22-2005
francescomoi@europe.com
 
Posts: n/a
Default SetHandler won't work in '.htaccess'

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

  #2 (permalink)  
Old 04-24-2005
Andy Davidson
 
Posts: n/a
Default Re: SetHandler won't work in '.htaccess'

[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.
  #3 (permalink)  
Old 04-25-2005
francescomoi@europe.com
 
Posts: n/a
Default Re: SetHandler won't work in '.htaccess'

Andy Davidson wrote:
> [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 ?

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. :(

 


Thread Tools
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:45 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0