Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just ran yum install php in the command prompt. Everything went fine ('complete!') as per the dialogue. I then uploaded a file that does not use short tags and is named with the proper extension (i.e., the name is test.php).

<?php print "hello world"; ?>

When I navigate my browser to test.php it just prints each of the characters shown above; i.e., PHP is not interpreting it.

What might be the problem? Also, if there is a configuration file that needs to be updated, please tell me what directory path I am likely to find that file.

Edit: Apache2 & Red Hat Enterprise 5.5

share|improve this question
    
Saying that you run "Redhat" is worthless. What version? Perhaps you should read How to Ask and then re-write your question. –  MDMarra Nov 19 '11 at 19:05
    
Yes, I am new to setting up servers. I acknowledeged, I should have put the edditions in. I tried to give a detailed description from the perspective of a newb dealing with a command line. I thought this was a place for learning (at any level). Why the '-1'? –  John R Nov 19 '11 at 22:30
    
The -1 wasn't from me, but I'd guess that it's from the complete lack of detail. –  MDMarra Nov 19 '11 at 22:34
    
I reread the rules, I don't know what else I am missing. –  John R Nov 19 '11 at 22:38
    
Perhaps you should ask on Meta Server Fault –  MDMarra Nov 19 '11 at 23:00
add comment

2 Answers

up vote 7 down vote accepted

Try

yum install mod_php 

This will load the php module for Apache.

share|improve this answer
    
This will install the php module for Apache, but you should still check your config files and make sure it will be loaded. –  Scott Pack Nov 20 '11 at 1:37
    
The conf file should automatically be placed in the /etc/httpd/conf.d/ directory –  ckliborn Nov 20 '11 at 5:18
add comment

Check apache (I presume you are running apache) is actually loading the php module, and has the correct handlers setup for .php files.

Sounds like a web server issue rather than a php issue.

share|improve this answer
    
Yes. I am running Apache2. –  John R Nov 19 '11 at 16:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.