Bug 219070 - apache won't parse php code
apache won't parse php code
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
5
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
http://forum.mamboserver.com/showthre...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-10 06:59 EST by Marco Nadal
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-14 11:32:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marco Nadal 2006-12-10 06:59:23 EST
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 11:32:31 EST
This looks like a configuration/support issue; this certainly does work out of
the box.  Please trying mailing fedora-list@redhat.com for further help.
Comment 2 Marco Nadal 2006-12-14 19:40:48 EST
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 04:02:40 EST
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.