LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-13-2011, 04:15 AM   #1
armsman
LQ Newbie
 
Registered: Sep 2011
Location: New Zealand
Distribution: Centos, Ubuntu
Posts: 19

Rep: Reputation: 0
Question PHP or Apache issues, displays as text only. On Centos 5


I'm very new to servers and have done alto of research on this but i am unable to find an answer I can understand.
I made index.php for an example with
Code:
<?php phpinfo(); ?>
Here: http://XXX.XX.XXX.XXX/index.php

Thank you in advance for any help on this matter

Last edited by armsman; 09-14-2011 at 04:12 AM.
 
Old 09-14-2011, 12:15 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,220

Rep: Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683
Hi,

How did you install php? If you used your package manager (yum) it should have taken care for this by adding the file /etc/httpd/conf.d/php.conf.
Anyway you need:
Code:
AddType application/x-httpd-php .php
Regards
 
Old 09-14-2011, 12:58 AM   #3
armsman
LQ Newbie
 
Registered: Sep 2011
Location: New Zealand
Distribution: Centos, Ubuntu
Posts: 19

Original Poster
Rep: Reputation: 0
tried that, said this

Code:
-bash: AddType: command not found
yes I used yum

I used this tutorial: http://www.techiecorner.com/125/how-...nux-using-yum/

Last edited by armsman; 09-14-2011 at 01:02 AM.
 
Old 09-14-2011, 01:51 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,220

Rep: Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683
It's not a command. It's an apache directive
You need to add it, if not already exists (or it's commented out) in /etc/httpd/conf.d/php.conf.and restart apache
 
Old 09-14-2011, 02:44 AM   #5
armsman
LQ Newbie
 
Registered: Sep 2011
Location: New Zealand
Distribution: Centos, Ubuntu
Posts: 19

Original Poster
Rep: Reputation: 0
As I said i'm kinda new to Linux servers, i'll need instructions :/
 
Old 09-14-2011, 03:28 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,220

Rep: Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683
What instructions do you need? If you have followed the tutorial you mentioned in your previous post, everything should be sorted.
The problem you meet is when the directive
Quote:
AddType application/x-httpd-php .php
does not exist in the apache configuration files.
So open /etc/httpd/conf.d/php.conf with your favorite editor and check if the above exists and it's not commented out (i.e. there is a # in front of it). If it doesn't exist, add it, or uncomment it and run
Code:
service httpd restart
to restart apache
 
Old 09-14-2011, 03:47 AM   #7
armsman
LQ Newbie
 
Registered: Sep 2011
Location: New Zealand
Distribution: Centos, Ubuntu
Posts: 19

Original Poster
Rep: Reputation: 0
Awesome, Works
Thanks Alot
 
Old 09-14-2011, 03:54 AM   #8
armsman
LQ Newbie
 
Registered: Sep 2011
Location: New Zealand
Distribution: Centos, Ubuntu
Posts: 19

Original Poster
Rep: Reputation: 0
Is there a reason I can't install ioncube?
Never Mind it's working

Last edited by armsman; 09-14-2011 at 04:02 AM.
 
Old 09-14-2011, 04:09 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,220

Rep: Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683
Glad to see it worked.
Edit your 1st post and mask your IP address if you don't want others to be able to see your phpinfo()
Also mark the thread Solved from the thread tools on top of the page

Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache22 displays my IP, not domain - Apache 2.2 on CentOS 5.5 alex4108 Linux - Software 1 06-30-2011 12:17 AM
Apache displays PHP scripts cov Linux - Server 9 06-01-2009 10:52 AM
Centos 5.2 running Apache 2 and PHP 4 cannot display info.php codenjanod Linux - Server 2 08-19-2008 02:00 AM
Centos 5, Apache, php, mysql Anauj0101 Linux - Server 5 02-26-2008 10:39 PM
Can't get PHP 5 to work on CentOS 4.2, Apache 2.0.52 tibberous Linux - Server 3 10-27-2007 06:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration