| 
 
 
 | 
| Keep Server Online 
 If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
 
 or
 
 
   
 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.
 |  | 
 | 
| | 
| | 
|  Topic: PHP is Downloaded instead of displayed |  |  
| Author |  |  
| acrym 
 
 
 Joined: 23 Apr 2014
 Posts: 3
 Location: United States, Bellingham
 
 | 
|  Posted: Wed 23 Apr '14 21:49    Post subject: PHP is Downloaded instead of displayed |   |  
| 
 |  
| 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: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Thu 24 Apr '14 18:28    Post subject: |   |  
| 
 |  
| 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
 
 | 
|  Posted: Fri 25 Apr '14 0:05    Post subject: |   |  
| 
 |  
| 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
 
 | 
|  Posted: Mon 28 Apr '14 23:06    Post subject: |   |  
| 
 |  
| Bump? I have no idea what to do... |  |  
| Back to top |  |  
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Tue 29 Apr '14 12:26    Post subject: |   |  
| 
 |  
| 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 |  |  
 
 | 
 |  | 
 |  |