logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP is Downloaded instead of displayed
Author
acrym



Joined: 23 Apr 2014
Posts: 3
Location: United States, Bellingham

PostPosted: Wed 23 Apr '14 21:49    Post subject: PHP is Downloaded instead of displayed Reply with quote

Operating System: CentOS Linux 5.6
Apache Version: 2.2.3, installed with Yum
PHP version: 5.1.6, installed with Yum

Using "httpd -M" shows that php5_module (shared) is loaded.

Running a command line "php {filename}" works fine.

Nothing is found in the error logs.

httpd.conf includes php.conf.

php.conf:

Code:
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

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

DirectoryIndex index.php


What do I do?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Thu 24 Apr '14 18:28    Post subject: Reply with quote

replace the two lines AddHandler and AddType with

AddHandler application/x-httpd-php .php
Back to top
acrym



Joined: 23 Apr 2014
Posts: 3
Location: United States, Bellingham

PostPosted: Fri 25 Apr '14 0:05    Post subject: Reply with quote

Thanks for replying. It didn't work. I changed it, restarted apache, cleared my browser cache and it still downloads the php file.
Back to top
acrym



Joined: 23 Apr 2014
Posts: 3
Location: United States, Bellingham

PostPosted: Mon 28 Apr '14 23:06    Post subject: Reply with quote

Bump? I have no idea what to do...
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Tue 29 Apr '14 12:26    Post subject: Reply with quote

Usually a yum install php -y should do it alone, if you install apache also via yum.

See http://articles.slicehost.com/2008/2/6/centos-installing-apache-and-php5

Sorry, I'm not an expert for CentOS / redhat linux.

Code:

<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

SetHandler application/x-httpd-php .php

DirectoryIndex index.php
Back to top


Reply to topic   Topic: PHP is Downloaded instead of displayed View previous topic :: View next topic
Post new topic   Forum Index -> Other Software