Java Mailing List Archive

http://www.redhatconfig.com/

Home » Red Hat Enterprise Linux 5 »

Re: [rhelv5-list] PHP code being printed and not interpreted

Brian Long

2008-04-10

Replies:

Author LoginPost Reply

On Thu, 2008-04-10 at 17:29 +0100, Mark Craven wrote:
> Hi All
>
> I have a funny little problem with PHP 5 and Apache 2 not properly
> handling php files that don't have a php extension on my new RHEL5
> server.
>
> We have a php file that does a redirect, so it doesn't have a .php
> extension (in fact it doesn't have any extension).

<snip>

> I've added the projects and users blocks to the php.conf on our new
> RHEL5 box, (which is a bit different), but instead of executing the PHP,
> Apache prints the code in the browser. Files with a .php extension are
> working fine.
>
> My new php.conf looks like this (I copied the projects block from the
> old server), the rest is out of the box.
>
> ######################################################
> LoadModule php5_module modules/libphp5.so
>
> #
> # Cause the PHP interpreter to handle files with a .php extension.
> #
> AddHandler php5-script .php
> AddType text/html .php
>
> #
> # make user the redirects of projects and users are handled as PHP files
> #
>
> <Files projects>
>    SetOutputFilter PHP
>    SetInputFilter PHP
>    AcceptPathInfo On
>    LimitRequestBody 734003200
> </Files>

I believe you need a <Directory> entry and SetHandler.

Look here for details:
http://httpd.apache.org/docs/2.2/mod/core.html#sethandler

/Brian/
--
    Brian Long                   |     |
                           . | | | . | | | .
                              '     '
                              C I S C O

_______________________________________________
rhelv5-list mailing list
rhelv5-list@(protected)
https://www.redhat.com/mailman/listinfo/rhelv5-list
©2008 redhatconfig.com - Jax Systems, LLC, U.S.A.