Java Mailing List Archive

http://www.redhatconfig.com/

Home » Red Hat Enterprise Linux 5 »

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

Mark Craven

2008-04-10

Replies:

Author LoginPost Reply
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).

Previously on Apache 2.0 with PHP 4 we had php.conf that looked like
this and it all worked fine.

######################################################
LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
  SetOutputFilter PHP
  SetInputFilter PHP
  AcceptPathInfo On
  LimitRequestBody 734003200
</Files>

<Files projects>
SetOutputFilter PHP
SetInputFilter PHP
AcceptPathInfo on
</Files>

<Files users>
SetOutputFilter PHP
SetInputFilter PHP
AcceptPathInfo on
</Files>

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
######################################################

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>

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
######################################################

There's nothing in the logs and I've been Googling away with no success.
Has anybody been running PHP in this way?

RPMS installed:
 php-5.1.6-15.el5
 httpd-2.2.3-11.el5

TIA
Mark
--
_________________________________________________________________________

            Mark Craven - Senior Systems Engineer
_________________________________________________________________________

 IT Department              Phone:   + 353-1-291-1314
 Silicon & Software Systems (S3)  Reception: + 353-1-291-1000
 South County Business Park     Fax:     + 353-1-291-1001
 Leopardstown               E-mail:   Mark.Craven@(protected)
 Dublin 18                 Seri:    markc@(protected)
 Ireland                  Web:     http://www.s3group.com
_________________________________________________________________________

The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
Please direct any additional queries to: communications@(protected).
Thank You.
Silicon and Software Systems Limited. Registered in Ireland no. 378073.
Registered Office: South County Business Park, Leopardstown, Dublin 18

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