Bug 219070

Summary: apache won't parse php code
Product: [Fedora] Fedora Reporter: Marco Nadal <marco75>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
URL: http://forum.mamboserver.com/showthread.php?t=89212
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-14 16:32:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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