Bug 219070 - apache won't parse php code
Summary: apache won't parse php code
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 5
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL: http://forum.mamboserver.com/showthre...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-10 11:59 UTC by Marco Nadal
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-12-14 16:32:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marco Nadal 2006-12-10 11:59:23 UTC
Description of problem:
By default, apache won't parse PHP code.

Version-Release number of selected component (if applicable):


How reproducible:
Very reproducible. Just install a LAMP server and this problem will show up
sooner or later.

Steps to Reproduce:
1. Install Apache, mySQL and PHP
2. Copy something written in PHP to the webroot (/var/wwwroot by default,
/home/wwwroot in my case)
3. Set permissions to apache,apache for all files and folders. Set "executable"
to ON for all .php files.
4. Type path to .php into browser
  
Actual results:
The browser will display the php source code

Expected results:
Browser should execute the code, producing a nicely formatted web page

Additional info:
To fix this problem, add the following line to /etc/httpd/conf/httpd.conf :

AddType application/x-httpd-php .php

and maybe change the line starting with "DirectoryIndex" to the following:

DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html
index.htm index.shtml index.phtml

Comment 1 Joe Orton 2006-12-14 16:32:31 UTC
This looks like a configuration/support issue; this certainly does work out of
the box.  Please trying mailing fedora-list for further help.

Comment 2 Marco Nadal 2006-12-15 00:40:48 UTC
Shouldn't the "application/x-httpd-php .php" handler be enabled by default? Why
purposely disable it? Or are you saying that it would work on a clean Fedora
install?

Comment 3 Joe Orton 2006-12-15 09:02:40 UTC
Yes, it works on a clean Fedora install - see /etc/httpd/conf.d/php.conf:

AddHandler php5-script .php
AddType text/html .php



Note You need to log in before you can comment on or make changes to this bug.